Module: check_mk
Branch: master
Commit: 1ce81f4656e085a0da7a2401bef76a463242e56e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1ce81f4656e085…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 28 10:24:23 2015 +0200
#2495 FIX printer_supply: Fixed exception when unit type is not available via SNMP
---
.werks/2495 | 10 ++++++++++
ChangeLog | 1 +
checks/printer_supply | 7 ++++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/2495 b/.werks/2495
new file mode 100644
index 0000000..fd7e061
--- /dev/null
+++ b/.werks/2495
@@ -0,0 +1,10 @@
+Title: printer_supply: Fixed exception when unit type is not available via SNMP
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1438071821
+
+
diff --git a/ChangeLog b/ChangeLog
index 5e905fa..3f38fc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,7 @@
* 1274 FIX: heartbeat_crm: Handle case of error messages from CRM
* 2488 FIX: veem_jobs: fix problems with spaces or single quotes in the names of
jobs...
* 2494 FIX: Clasic SNMP mode now uses normal snmpwalk when bulkwalks are disabled
with SNMPv3
+ * 2495 FIX: printer_supply: Fixed exception when unit type is not available via SNMP
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/printer_supply b/checks/printer_supply
index 88f8d6d..c283519 100644
--- a/checks/printer_supply
+++ b/checks/printer_supply
@@ -105,7 +105,12 @@ def check_printer_supply(item, params, info):
# 4 = supplyThatIsFilled
# the value is contains the current level if this supply is a container
# but when the remaining space if this supply is a receptacle
- unit_type = int(line[3])
+ #
+ # This table can be missing on some devices. Assume type 3 in this case.
+ if line[3] == '':
+ unit_type = 3
+ else:
+ unit_type = int(line[3])
if type(params) == tuple:
if len(params) == 2: