Module: check_mk
Branch: master
Commit: 1a021da89b0ea5e85c92cac8a32d354ea2f519c3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a021da89b0ea5…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Sep 27 14:20:54 2018 +0200
6734 FIX ibm_svc_enclosure: Fixed parsing data of IBM-FLASH900 devices
Change-Id: I0f6dea3bba70f443fa4a12ed78d28c45c6752300
---
.werks/6734 | 10 ++++++++++
checks/ibm_svc_enclosure | 19 +++++++++++++++----
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/.werks/6734 b/.werks/6734
new file mode 100644
index 0000000..913309a
--- /dev/null
+++ b/.werks/6734
@@ -0,0 +1,10 @@
+Title: ibm_svc_enclosure: Fixed parsing data of IBM-FLASH900 devices
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1538050756
+Class: fix
+
+
diff --git a/checks/ibm_svc_enclosure b/checks/ibm_svc_enclosure
index 049f9e3..c8ce669 100644
--- a/checks/ibm_svc_enclosure
+++ b/checks/ibm_svc_enclosure
@@ -46,6 +46,10 @@
# The names of the columns are:
#
id:status:type:managed:IO_group_id:IO_group_name:product_MTM:serial_number:total_canisters:online_canisters:total_PSUs:online_PSUs:drive_slots:total_fan_modules:online_fan_modules:total_sems:online_sems
+# IBM-FLASH900
+# <<<ibm_svc_enclosure:sep(58)>>>
+# 1:online:control:9843-AE2:6860407:2:2:2:12
+
def inventory_ibm_svc_enclosure(info):
inventory = []
@@ -54,13 +58,20 @@ def inventory_ibm_svc_enclosure(info):
inventory.append( (enclosure_id, None) )
return inventory
+
def check_ibm_svc_enclosure(item, _no_params, info):
for line in info:
if line[0] == item:
- if len(line) < 15: # old(est) format
- line = line + ["0", "0", "0",
"0"] # do not modify line!
- if len(line) < 17: # old format
- line = line + ["0", "0"] # do not modify line!
+ if len(line) == 9:
+ line = line[:2] + [None, None, None] + line[2:6] + ["0"] +
line[6:] + ["0", "0", "0", "0"]
+ elif len(line) == 13:
+ line = line + ["0", "0", "0",
"0"]
+ elif len(line) == 15:
+ line = line + ["0", "0"]
+ elif len(line) == 17:
+ pass
+ else:
+ return 3, "Unknown format"
enclosure_id, enclosure_status, _enclosure_type, _managed, _IO_group_id, \
_IO_group_name, _product_MTM, _serial_number, total_canisters,
online_canisters, \