Module: check_mk
Branch: master
Commit: 6b16a3ef53b58036f169d8cddae20da5393006b9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6b16a3ef53b580…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 26 09:25:17 2015 +0100
Now correctly handling supplies which are consumed but report a maximum capacity of 0
---
checks/printer_supply | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/checks/printer_supply b/checks/printer_supply
index 9c5a7f6..661972a 100644
--- a/checks/printer_supply
+++ b/checks/printer_supply
@@ -119,7 +119,7 @@ def check_printer_supply(item, params, info):
# no percentage possible. We compare directly against levels
return (0, "current level is %d" % current,
[("pages", current)])
- if upturn or unit_type == 4: # it's filling up!
+ if upturn or (unit_type == 3 and maxlevel == 0):
leftperc = 100 - current
else:
leftperc = 100.0 * current / maxlevel