aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sven Nierlein <sven@nierlein.org> 2013-08-15 02:26:08 -0700
committerGravatar Sven Nierlein <sven@nierlein.org> 2013-08-15 02:26:08 -0700
commitbb3bf05856dc4feafca78c5f83edd48e6bde8064 (patch)
tree7c818237a17ffb93fe74082f724221d91fb150ca
parent2e6a0138de4eb87138372e25f9d895f816c8dd32 (diff)
parent9be408511cbf10e4e4b5750459bf2a6d2e23d89d (diff)
downloadmonitoring-plugins-bb3bf05856dc4feafca78c5f83edd48e6bde8064.tar.gz
Merge pull request #54 from g0hl1n/check_apt_-_run_update_upgrade_return_fix
check_apt now correctly exits when apt-get return != 0
-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 433055b5..daeb7578 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -112,8 +112,8 @@ int main (int argc, char **argv) {
result = max_state(result, STATE_CRITICAL);
} else if(packages_available > 0){
result = max_state(result, STATE_WARNING);
- } else {
- result = max_state(result, STATE_OK);
+ } else if(result > STATE_UNKNOWN){
+ result = STATE_UNKNOWN;
}
printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s|available_upgrades=%d;;;0 critical_updates=%d;;;0\n"),