The check plugin check_autoremove monitors whether any software packages were just dependencies of others and may be removed.
The plug-and-play Linux binaries take the following CLI arguments and no environment variables:
$ ./check_autoremove [-warn THRESHOLD] [-crit THRESHOLD]
THRESHOLD specifies an alert threshold range
conforming to the Nagio$ check plugin API,
-warn @~:42 warns if there are <= 42 unneeded dependencies.
To print the legal info, execute the plugin in a terminal:
In this case the program will always terminate with exit status 3 ("unknown") without actually checking anything.
If you want to actually execute a check inside a terminal, you have to connect the standard output of the plugin to anything other than a terminal – e.g. the standard input of another process:
$ ./check_autoremove |cat
In this case the exit code is likely to be the cat's one. This can be worked around like this:
bash $ set -o pipefail bash $ ./check_autoremove |cat
Just integrate the plugin into the monitoring tool of your choice like any other check plugin. (Consult that tool's manual on how to do that.) It should work with any monitoring tool supporting the Nagio$ check plugin API.
- check_autoremove must be run on the host to be checked – either with an agent of your monitoring tool or by SSH. Otherwise it will check the host your monitoring tool runs on.
- The check_autoremove binary must be owned by root
and the setuid bit must be set, i.e.:
chown root .../check_autoremove; chmod u+s .../check_autoremove