Module: check_mk
Branch: master
Commit: 23ccdbfbf8112707cf1b957d22de659b66a3e5be
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=23ccdbfbf81127…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Nov 10 11:42:52 2015 +0100
#2700 FIX ibm_svc_node: fixed handling with agent output after firmware update
---
.werks/2700 | 9 +++++++++
ChangeLog | 1 +
checks/ibm_svc_node | 42 ++++++++++++++++++++++++++----------------
3 files changed, 36 insertions(+), 16 deletions(-)
diff --git a/.werks/2700 b/.werks/2700
new file mode 100644
index 0000000..c2b2d25
--- /dev/null
+++ b/.werks/2700
@@ -0,0 +1,9 @@
+Title: ibm_svc_node: fixed handling with agent output after firmware update
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447152046
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 49cfed1..863a120 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -62,6 +62,7 @@
* 2754 FIX: ipmitool: Killing asynchronous ipmitool call after 300 seconds...
* 2755 FIX: apc_symmetra: Check is handling missing data more robust now
* 2783 FIX: esx_vsphere_datastores: fixed crash when no provisioning levels were set
+ * 2700 FIX: ibm_svc_node: fixed handling with agent output after firmware update
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/ibm_svc_node b/checks/ibm_svc_node
index 04c0bce..a9b2bed 100644
--- a/checks/ibm_svc_node
+++ b/checks/ibm_svc_node
@@ -28,14 +28,23 @@
# Put here the example output from your TCP-Based agent. If the
# check is SNMP-Based, then remove this section
+# newer agent output with more columns
+#
1:N1_164191:10001AA202:500507680100D7CA:online:0:io_grp0:no:2040000051442002:CG8:iqn.1986-03.com.ibm:2145.svc-cl.n1164191::164191:::::
+#
2:N2_164373:10001AA259:500507680100D874:online:0:io_grp0:no:2040000051442149:CG8:iqn.1986-03.com.ibm:2145.svc-cl.n2164373::164373:::::
+#
5:N3_162711:100025E317:500507680100D0A7:online:1:io_grp1:no:2040000085543047:CG8:iqn.1986-03.com.ibm:2145.svc-cl.n3162711::162711:::::
+#
6:N4_164312:100025E315:500507680100D880:online:1:io_grp1:yes:2040000085543045:CG8:iqn.1986-03.com.ibm:2145.svc-cl.n4164312::164312:::::
+
def inventory_ibm_svc_node(info):
io_groups = {}
inventory = []
- for node_id, node_name, ups_serial, wwnn, node_status, io_group_id, \
- io_group_name, config_node, ups_unique_id, hardware, iscsi_name, \
- iscsi_alias, panel_name, enclosure_id, canister_id, \
- enclosure_serial_number, additional in info:
- io_groups[io_group_name] = 1
+ for line in info:
+ node_id, node_name, ups_serial, wwnn, node_status, io_group_id,\
+ io_group_name, config_node, ups_unique_id, hardware, iscsi_name,\
+ iscsi_alias, panel_name, enclosure_id, canister_id,\
+ enclosure_serial_number, additional = line[:17]
+ io_groups[io_group_name] = 1
+ for line in info:
+ io_groups[line[5]] = 1
for io_group_name in io_groups.keys():
inventory.append( (io_group_name, None) )
return inventory
@@ -46,17 +55,18 @@ def check_ibm_svc_node(item, _no_params, info):
online_nodes = 0
nodes_of_iogroup = 0
- for node_id, node_name, ups_serial, wwnn, node_status, io_group_id, \
- io_group_name, config_node, ups_unique_id, hardware, iscsi_name, \
- iscsi_alias, panel_name, enclosure_id, canister_id, \
- enclosure_serial_number, additional in info:
- if io_group_name == item:
- if message != "":
- message += ", "
- message += "Node %s is %s" % (node_name, node_status)
- nodes_of_iogroup += 1
- if node_status == "online":
- online_nodes += 1
+ for line in info:
+ node_id, node_name, ups_serial, wwnn, node_status, io_group_id,\
+ io_group_name, config_node, ups_unique_id, hardware, iscsi_name,\
+ iscsi_alias, panel_name, enclosure_id, canister_id,\
+ enclosure_serial_number, additional = line[:17]
+ if io_group_name == item:
+ if message != "":
+ message += ", "
+ message += "Node %s is %s" % (node_name, node_status)
+ nodes_of_iogroup += 1
+ if node_status == "online":
+ online_nodes += 1
if nodes_of_iogroup == 0:
return 3, "IO Group %s not found in agent output" % item