summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRichard Leitner <me@g0hl1n.net>2013-05-29 22:05:17 (GMT)
committerRichard Leitner <me@g0hl1n.net>2013-05-29 22:05:17 (GMT)
commit9be408511cbf10e4e4b5750459bf2a6d2e23d89d (patch)
treed6703289961f5774c467eae51439db5c582b740a /plugins
parent1fd504b6117af25d3baa0c1afc5dbf7fc3c66f2c (diff)
downloadmonitoring-plugins-9be408511cbf10e4e4b5750459bf2a6d2e23d89d.tar.gz
check_apt now correctly exits when apt-get return != 0refs/pull/54/head
This commit fixes an issue with check_apt where check_apt doesn't exit with the appropriate return code when apt-get returned a non-zero value.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_apt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index 7ec2d55..0e95dc3 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -112,8 +112,8 @@ int main (int argc, char **argv) {
112 result = max_state(result, STATE_CRITICAL); 112 result = max_state(result, STATE_CRITICAL);
113 } else if(packages_available > 0){ 113 } else if(packages_available > 0){
114 result = max_state(result, STATE_WARNING); 114 result = max_state(result, STATE_WARNING);
115 } else { 115 } else if(result > STATE_UNKNOWN){
116 result = max_state(result, STATE_OK); 116 result = STATE_UNKNOWN;
117 } 117 }
118 118
119 printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), 119 printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"),