Module: check_mk
Branch: master
Commit: b0a5eda39ed7eacc1e3f99a12740b0435d735133
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b0a5eda39ed7ea…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 25 14:33:15 2016 +0100
#2951 FIX ibm_svc_disks: Fixed exception with disks having a TB capacity
---
.werks/2951 | 9 +++++++++
ChangeLog | 1 +
checks/ibm_svc_disks | 13 +++++++++++--
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/.werks/2951 b/.werks/2951
new file mode 100644
index 0000000..09fc084
--- /dev/null
+++ b/.werks/2951
@@ -0,0 +1,9 @@
+Title: ibm_svc_disks: Fixed exception with disks having a TB capacity
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453728736
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 565e35c..fa27960 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -208,6 +208,7 @@
* 2948 FIX: oracle_tablespaces: Fixed exception when section contained empty line
* 2949 FIX: oracle_logswitches oracle_sessions oracle_version: Improved handling of
legacy oracle plugin error cases
* 2950 FIX: citrix_controller.sessions: Fixed crash in case active/inactive infos are
missing
+ * 2951 FIX: ibm_svc_disks: Fixed exception with disks having a TB capacity
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/ibm_svc_disks b/checks/ibm_svc_disks
index 7fb028b..82dfb08 100644
--- a/checks/ibm_svc_disks
+++ b/checks/ibm_svc_disks
@@ -61,17 +61,26 @@ def check_ibm_svc_disks(_no_item, params, info):
did, status, error_sequence_number, use, tech_type,\
capacity, mdisk_id, mdisk_name, member_id, enclosure_id,\
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'):
disk['capacity'] = float(capacity[:-2]) * 1024 * 1024 * 1024
- # Failure State can be found here,
- # also spare is a state here
+ elif capacity.endswith('TB'):
+ disk['capacity'] = float(capacity[:-2]) * 1024 * 1024 * 1024 * 1024
+ elif capacity.endswith('PB'):
+ disk['capacity'] = float(capacity[:-2]) * 1024 * 1024 * 1024 * 1024 *
1024
+
+ # Failure State can be found here, also spare is a state here
disk['state'] = use
if status == "offline" and use != "failed":
disk['state'] = "offline"
+
disk['type'] = "" # We dont have a type
+
disks.append(disk)
+
return check_filer_disks(disks, params)
check_info["ibm_svc_disks"] = {