diff options
Diffstat (limited to 'example/site_check_mk/files/agent/apt')
-rw-r--r-- | example/site_check_mk/files/agent/apt/check_apt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/example/site_check_mk/files/agent/apt/check_apt b/example/site_check_mk/files/agent/apt/check_apt new file mode 100644 index 0000000..223dd8a --- /dev/null +++ b/example/site_check_mk/files/agent/apt/check_apt @@ -0,0 +1,15 @@ +#!/bin/sh +# check_apt wrapper to gather more info about pending packages + +# call the original plugin +MSG=`/usr/lib/nagios/plugins/check_apt $*` + +EXIT=$? + +echo -n $MSG | sed 's/available for upgrade/upgradable/' | sed 's/ updates//' | sed 's/\./:/' + +if [ "$EXIT" != "0" ] +then +apt-get -s upgrade|egrep '(^ |wi ll be up|kept back)'|sed 's/The following packages will be upgraded://'| tr '\n' ' ' | sed 's/ */ /g' +exit $EXIT +fi |