Module: check_mk
Branch: master
Commit: 4a50902ce933c6436732acab982d944abdfaeca6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4a50902ce933c6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Jun 21 17:26:45 2014 +0200
ibm_svc_enclosure: support new firmware, also check fan modules
---
.werks/1003 | 8 ++++++++
ChangeLog | 1 +
checkman/ibm_svc_enclosure | 7 ++++---
checks/ibm_svc_enclosure | 45 +++++++++++++++++++++++++++++++-------------
4 files changed, 45 insertions(+), 16 deletions(-)
diff --git a/.werks/1003 b/.werks/1003
new file mode 100644
index 0000000..6692635
--- /dev/null
+++ b/.werks/1003
@@ -0,0 +1,8 @@
+Title: ibm_svc_enclosure: support new firmware, also check fan modules
+Level: 1
+Component: checks
+Version: 1.2.5i4
+Date: 1403364378
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 3f83ad6..a9af5d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* 0618 adva_fsp_current: new check for the power supply units of the ADVA FSP 3000
scalable optical transport solution
* 0619 adva_fsp_temp: new check to monitor temperature and temperature trends on ADVA
scalable optical transport solutions
* 0993 raritan_pdu_inlet: now delivers performance data
+ * 1003 ibm_svc_enclosure: support new firmware, also check fan modules
* 0616 FIX: brocade.fan, brocade.power, brocade.temp: will now only discover services
which are not marked as absent
* 0992 FIX: zfs_arc_cache: returns OK even if values of arc meta are missing...
* 0936 FIX: agent_ibmsvc: improved error messages on using wrong credentials
diff --git a/checkman/ibm_svc_enclosure b/checkman/ibm_svc_enclosure
index 3314256..bdaef01 100644
--- a/checkman/ibm_svc_enclosure
+++ b/checkman/ibm_svc_enclosure
@@ -8,11 +8,12 @@ description:
V7000 device.
Returns {OK} if the Enclousure report status {online} and all Canisters and PSUs
- are online and {CRIT} otherwise.
+ are online and {CRIT} otherwise. If the firmware supports it then also fan modules
+ are being checked.
- Please note: You need the Special Agent agent_ibmsvc to retrieve the monitoring
+ Please note: You need the special agent {agent_ibmsvc} for retrieving the monitoring
data from the device. Your monitoring user must be able to SSH to the device
- with SSH Key Authentification. Please exchange SSH key. The Special Agent itself
+ with SSH Key Authentification. Please exchange SSH key. The special agent itself
can be configured by WATO.
item:
diff --git a/checks/ibm_svc_enclosure b/checks/ibm_svc_enclosure
index 2d3907e..9df794a 100644
--- a/checks/ibm_svc_enclosure
+++ b/checks/ibm_svc_enclosure
@@ -31,19 +31,32 @@
# 3:online:expansion:yes:0:io_grp0:2072-24E:7804326:2:2:2:2:24
# 4:online:expansion:yes:0:io_grp0:2072-24E:7804352:2:2:2:2:24
+# After a firmware upgrade the output looked like this:
+# 1:online:control:yes:0:io_grp0:2072-24C:7804037:2:2:2:2:24:0:0
+# 2:online:expansion:yes:0:io_grp0:2072-24E:7804306:2:2:2:2:24:0:0
+# 3:online:expansion:yes:0:io_grp0:2072-24E:7804326:2:2:2:2:24:0:0
+# 4:online:expansion:yes:0:io_grp0:2072-24E:7804352:2:2:2:2:24:0:0
+
+# 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
+
+
def inventory_ibm_svc_enclosure(info):
inventory = []
- for enclosure_id, enclosure_status, enclosure_type, managed, IO_group_id, \
- IO_group_name, product_MTM, serial_number, total_canisters, online_canisters, \
- total_PSUs, online_PSUs, drive_slots in info:
+ for line in info:
+ enclosure_id = line[0]
inventory.append( (enclosure_id, None) )
return inventory
def check_ibm_svc_enclosure(item, _no_params, info):
- for enclosure_id, enclosure_status, enclosure_type, managed, IO_group_id, \
- IO_group_name, product_MTM, serial_number, total_canisters, online_canisters, \
- total_PSUs, online_PSUs, drive_slots in info:
- if enclosure_id == item:
+ for line in info:
+ if line[0] == item:
+ if len(line) < 15: # old format
+ line = line + ["0", "0"] # do not modify line!
+
+ enclosure_id, enclosure_status, enclosure_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 = line
# Check status
message = "Enclosure %s is %s" % (enclosure_id, enclosure_status)
@@ -55,19 +68,25 @@ def check_ibm_svc_enclosure(item, _no_params, info):
# Check canisters
if online_canisters == total_canisters:
- status = max(0, status)
message += ", all %s canisters are online" % total_canisters
else:
- status = max(2, status)
- message += ", %s(!!) of %s canisters are online" %
(online_canisters, total_canisters)
+ status = 2
+ message += ", only %s of %s canisters are online(!!)" %
(online_canisters, total_canisters)
# Check PSUs
if online_PSUs == total_PSUs:
- status = max(0, status)
message += ", all %s PSUs are online" % total_PSUs
else:
- status = max(2, status)
- message += ", %s(!!) of %s PSUs are online" % (online_PSUs,
total_PSUs)
+ status = 2
+ message += ", only %s of %s PSUs are online(!!)" %
(online_PSUs, total_PSUs)
+
+ # Check FANs (only new firmware)
+ if online_fan_modules == total_fan_modules:
+ if total_fan_modules != "0":
+ message += ", all %s fan modules are online" %
total_fan_modules
+ else:
+ status = 2
+ message += ", only %s of %s fan modules are online(!!)" %
(online_fan_modules, total_fan_modules)
return status, message