Module: check_mk
Branch: master
Commit: c1b21775ba384fe82d2a2152fb84affe46a4037b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c1b21775ba384f…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Thu Jun 7 17:55:05 2018 +0200
6221 FIX emc_datadomain_disks: Fix crash caused by missing busy data
Some devices do not report busy stats for disks via SNMP. Previously, the
check would crash, thus shadowing the status monitoring. This has been fixed.
---
.werks/6221 | 12 ++++++++++++
checks/emc_datadomain_disks | 14 ++++++++------
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/.werks/6221 b/.werks/6221
new file mode 100644
index 0000000..6567b5d
--- /dev/null
+++ b/.werks/6221
@@ -0,0 +1,12 @@
+Title: emc_datadomain_disks: Fix crash caused by missing busy data
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1528386821
+
+Some devices do not report busy stats for disks via SNMP. Previously, the
+check would crash, thus shadowing the status monitoring. This has been fixed.
diff --git a/checks/emc_datadomain_disks b/checks/emc_datadomain_disks
index dc68c51..7ff8705 100644
--- a/checks/emc_datadomain_disks
+++ b/checks/emc_datadomain_disks
@@ -46,14 +46,16 @@ def check_emc_datadomain_disks(item, _no_params, info):
serial = line[4]
capacity = line[5]
dev_state = line[6]
- index = int(line[7].split('.')[1]) - 1
- busy = info[1][index][0]
dev_state_str = state_table.get(dev_state, ("Unknown",3))[0]
dev_state_rc = state_table.get(dev_state, ("Unknown",3))[1]
- infotext = "%s, busy %s%% - %s, Firmware %s, Serial %s, Capacity
%s" \
- % ( dev_state_str, busy, model, firmware, serial, capacity )
- perfdata = [('busy', busy+"%" )]
- return dev_state_rc, infotext,perfdata
+ yield dev_state_rc, dev_state_str
+ index = int(line[7].split('.')[1]) - 1
+ if len(info[1]) > index:
+ busy = info[1][index][0]
+ perfdata = [('busy', busy+"%" )]
+ yield 0, "busy %s%%" % busy, perfdata
+ yield 0, "Model %s, Firmware %s, Serial %s, Capacity %s" % ( model,
firmware, serial, capacity )
+
check_info["emc_datadomain_disks"] = {
"check_function" : check_emc_datadomain_disks,