Module: check_mk
Branch: master
Commit: 6529c89ac1efafc0fb2ebb09dd0b89422f667c71
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6529c89ac1efaf…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 26 16:21:52 2016 +0100
#2983 FIX netapp_api_disk: fixed exception when disks were not included in the raid
Some disks on the netapp filer have the raid-state set to unknown and
had no physical space information available. The check was unable to handle this.
---
.werks/2983 | 10 ++++++++++
ChangeLog | 1 +
checks/filerdisks.include | 2 +-
checks/netapp_api_disk | 3 ++-
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/2983 b/.werks/2983
new file mode 100644
index 0000000..5a2ce7b
--- /dev/null
+++ b/.werks/2983
@@ -0,0 +1,10 @@
+Title: netapp_api_disk: fixed exception when disks were not included in the raid
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453821511
+Class: fix
+
+Some disks on the netapp filer have the raid-state set to unknown and
+had no physical space information available. The check was unable to handle this.
diff --git a/ChangeLog b/ChangeLog
index 8cb7aec..0895767 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -223,6 +223,7 @@
* 2961 FIX: tsm_sessions: Fixed crash in cae of client name contains spaces
* 2962 FIX: esx_vsphere_vm.guest_tools: Fixed exception in case no version info is available
* 2963 FIX: esx_vsphere_datastores: Deal with empty url attribute of datastores
+ * 2983 FIX: netapp_api_disk: fixed exception when disks were not included in the raid...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/filerdisks.include b/checks/filerdisks.include
index 2361f71..f8ef316 100644
--- a/checks/filerdisks.include
+++ b/checks/filerdisks.include
@@ -47,7 +47,7 @@ def check_filer_disks(disks, params):
prefaild_parity_disk_count = 0
for disk in disks:
- total_capacity += disk["capacity"]
+ total_capacity += disk.get("capacity", 0)
for what in state.keys():
if disk['state'] == what:
state[what].append(disk)
diff --git a/checks/netapp_api_disk b/checks/netapp_api_disk
index e2e148b..0ea87bb 100644
--- a/checks/netapp_api_disk
+++ b/checks/netapp_api_disk
@@ -57,6 +57,8 @@ def check_netapp_api_disk_summary(_no_item, params, info):
disk_info = "Serial: %s" % disk.get("serial-number")
if "physical-space" in disk:
disk_info += ", Size: %s" % get_bytes_human_readable(int(disk["physical-space"]))
+ disk['capacity'] = int(disk['physical-space'])
+
disk['identifier'] = disk_info
disk['type'] = False
raid_type = disk.get("raid-type")
@@ -73,7 +75,6 @@ def check_netapp_api_disk_summary(_no_item, params, info):
disk['state'] = "spare"
else:
disk['state'] = 'ok'
- disk['capacity'] = int(disk['physical-space'])
disks_converted.append(disk)