Module: check_mk
Branch: master
Commit: f2e4012fceca89bd3741e8d068482794012df08c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f2e4012fceca89…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Nov 2 10:19:37 2015 +0100
#2445 FIX ibm_svc_disks: fixed crash in case special agent reports too much data columns
per line
---
.werks/2445 | 9 +++++++++
ChangeLog | 1 +
checks/ibm_svc_disks | 9 +++++++--
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/2445 b/.werks/2445
new file mode 100644
index 0000000..c69cc1e
--- /dev/null
+++ b/.werks/2445
@@ -0,0 +1,9 @@
+Title: ibm_svc_disks: fixed crash in case special agent reports too much data columns per
line
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446455633
+
diff --git a/ChangeLog b/ChangeLog
index f9e481b..e8372b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
* 1297 FIX: emcvnx_hba: Prevent old emc versions from inventory...
* 2698 FIX: ups_capacity: fixed missing battery time and fuel information
* 2672 FIX: mounts: ignore options that are allowed to change on btrfs
filesystems...
+ * 2445 FIX: ibm_svc_disks: fixed crash in case special agent reports too much data
columns per line
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/ibm_svc_disks b/checks/ibm_svc_disks
index a26ba40..7fb028b 100644
--- a/checks/ibm_svc_disks
+++ b/checks/ibm_svc_disks
@@ -48,14 +48,19 @@
# 18:online::member:sas_hdd:558.4GB:16:V7BRZ_mdisk19:2:1:6::
# 19:online::member:sas_hdd:558.4GB:16:V7BRZ_mdisk19:1:1:5::
+# newer versions report an additional column
+# 0:online::member:sas_hdd:558.4GB:7:V7RZ_mdisk8:4:1:24:::inactive
+# 1:online::member:sas_hdd:558.4GB:7:V7RZ_mdisk8:3:1:23:::inactive
+
def inventory_ibm_svc_disks(info):
return [ (None, {}) ]
def check_ibm_svc_disks(_no_item, params, info):
disks = []
- for did, status, error_sequence_number, use, tech_type,\
+ for line in info:
+ did, status, error_sequence_number, use, tech_type,\
capacity, mdisk_id, mdisk_name, member_id, enclosure_id,\
- slot_id, node_id, node_name in info:
+ slot_id, node_id, node_name = line[:13]
disk = {}
disk['identifier'] = "Enclosure: %s, Slot: %s, Type: %s" % (
enclosure_id, slot_id, tech_type )
if capacity.endswith('GB'):