Module: check_mk
Branch: master
Commit: cae0a223d4b582a44f5ea48053993921b20f4d84
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cae0a223d4b582…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Mar 16 18:01:10 2011 +0100
printer_supply: Skipping inventory of supplies which have current value
and maxlevel both set to -2.
---
ChangeLog | 2 ++
checks/printer_supply | 4 +++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f23596e..cfe6bfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,8 @@
* FIX: cmctc: fix inventory in case of incomplete entries
* printer_supply: Changed order of tests. When a printer reports -3 this
is used before the check if maxlevel is -2.
+ * printer_supply: Skipping inventory of supplies which have current value
+ and maxlevel both set to -2.
* cisco_locif: The check has been removed. Please switch to if/if64
* if/if64: scan function now also detects devices where the first port
has not the index 1
diff --git a/checks/printer_supply b/checks/printer_supply
index 66bb7d6..1532201 100644
--- a/checks/printer_supply
+++ b/checks/printer_supply
@@ -73,7 +73,9 @@ def printer_supply_fix_infos(info):
return info
def inventory_printer_supply(checkname, info):
- return [ (line[0], "printer_supply_default_levels") for line in
printer_supply_fix_infos(info) ]
+ # Ignore devices which show -2 for current value and -2 for max value -> useless
+ return [ (line[0], "printer_supply_default_levels") for line in
printer_supply_fix_infos(info)
+ if savefloat(line[2]) != -2 and
float(line[1]) != -2 ]
def check_printer_supply(item, params, info):
for line in printer_supply_fix_infos(info):