Module: check_mk
Branch: master
Commit: bb389f29258701761479076bf347cd822ef245a7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bb389f29258701…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Mar 9 17:00:24 2011 +0100
printer_supply: Changed order of tests.
When a printer reports -3 this is used before the check if maxlevel is -2.
---
ChangeLog | 4 ++++
checks/printer_supply | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f4eb79d..d20271a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
Multisite:
* Added snmp_uptime and uptime perfometers
+ Checks & Agents:
+ * printer_supply: Changed order of tests. When a printer reports -3 this
+ is used before the check if maxlevel is -2.
+
1.1.10:
Core, Setup, etc.:
* --flush now also deletes all autochecks
diff --git a/checks/printer_supply b/checks/printer_supply
index 4d61b53..66bb7d6 100644
--- a/checks/printer_supply
+++ b/checks/printer_supply
@@ -86,11 +86,11 @@ def check_printer_supply(item, params, info):
perfdata = [ ("pages", current, warn / 100.0 * maxlevel, crit /
100.0 * maxlevel, 0, maxlevel ) ]
if current == -1 or maxlevel == -1:
return (0, "OK - there are no restrictions on this supply")
- elif current == -2 or maxlevel == -2:
- return (3, "UNKNOWN - Couldn't get info about supply")
elif current == -3:
return (printer_supply_some_remaining_status, "%s - Some
remaining" %
(nagios_state_names[printer_supply_some_remaining_status]),
perfdata)
+ elif current == -2 or maxlevel == -2:
+ return (3, "UNKNOWN - Couldn't get info about supply")
elif leftperc <= crit:
return (2, "CRIT - %s" % infotext, perfdata)
elif leftperc <= warn: