Module: check_mk
Branch: master
Commit: 36877004c758a3840f248bef576960e986eddf68
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=36877004c758a3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 3 11:36:15 2015 +0200
#2577 FIX printer_input, printer_output: Fix exception on Brother NC-340h
---
.werks/2577 | 10 ++++++++++
ChangeLog | 1 +
checks/printer_io.include | 9 +++++++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/.werks/2577 b/.werks/2577
new file mode 100644
index 0000000..4389574
--- /dev/null
+++ b/.werks/2577
@@ -0,0 +1,10 @@
+Title: printer_input, printer_output: Fix exception on Brother NC-340h
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1441272917
+
+
diff --git a/ChangeLog b/ChangeLog
index 942079e..a818cc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -157,6 +157,7 @@
* 2566 FIX: ups_modulys_battery.temp: fixed missing manpage
* 2585 FIX: include file for elecritcal phases handles warn/crit levels correct
* 2576 FIX: symantec_av_updates: fix crash due to missing datetime module, also
handle DD.MM.YYYY date format
+ * 2577 FIX: printer_input, printer_output: Fix exception on Brother NC-340h
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/printer_io.include b/checks/printer_io.include
index dce786b..91887a0 100644
--- a/checks/printer_io.include
+++ b/checks/printer_io.include
@@ -25,8 +25,9 @@
# Boston, MA 02110-1301 USA.
printer_io_units = {
- '-1' : "unk.",
- '3' : 'tenThousandthsOfInches',
+ '-1' : 'unknown',
+ '0' : 'unknown',
+ '3' : '1/10000 in',
'4' : 'micrometers',
'8' : 'sheets',
'16' : 'feet',
@@ -72,6 +73,10 @@ def inventory_printer_io(info):
index, name, descr, status = line[:4]
if descr == '':
continue
+ snmp_status, capacity_unit, capacity_max, level = line[3:]
+ if capacity_max == '0': # useless
+ continue
+
ignore = False
snmp_status = saveint(status)
for state_val in sorted(printer_io_states,reverse=True):