Module: check_mk
Branch: master
Commit: a95ae6be4c205f8dd904d84e37304d43331d1aa6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a95ae6be4c205f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Oct 28 16:46:04 2015 +0100
#1297 FIX emcvnx_hba: Prevent old emc versions from inventory
Old Versions of EMC don't have any information about Read and Write blocks, so that
check crashed.
---
.werks/1297 | 11 +++++++++++
ChangeLog | 1 +
checks/emcvnx_hba | 11 +++++++----
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/.werks/1297 b/.werks/1297
new file mode 100644
index 0000000..1d0cb61
--- /dev/null
+++ b/.werks/1297
@@ -0,0 +1,11 @@
+Title: emcvnx_hba: Prevent old emc versions from inventory
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446047081
+
+Old Versions of EMC don't have any information about Read and Write blocks, so that
check crashed.
+
diff --git a/ChangeLog b/ChangeLog
index 942347d..12497f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
* 2669 FIX: mcdata_fcport: fix computation of in and out traffic...
* 2692 FIX: check_http: Fixed broken check when using Nagios (introduced with
1.2.7i3)
* 2706 FIX: winperf_if: fixed rare crashes of windows_if.ps1 plugin...
+ * 1297 FIX: emcvnx_hba: Prevent old emc versions from inventory...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/emcvnx_hba b/checks/emcvnx_hba
index 86aaf7d..a0acde7 100644
--- a/checks/emcvnx_hba
+++ b/checks/emcvnx_hba
@@ -94,14 +94,16 @@ def parse_emcvnx_hba(info):
return parsed
-def inventory_emcvnx_hba(info):
- return [ (hba, None) for hba in parse_emcvnx_hba(info).keys() ]
+def inventory_emcvnx_hba(parsed):
+ for hba, values in parsed.items():
+ # Old Versions of EMC don't have any Information
+ if values:
+ yield hba, None
-def check_emcvnx_hba(item, _no_params, info):
+def check_emcvnx_hba(item, _no_params, parsed):
now = time.time()
perfdata = []
- parsed = parse_emcvnx_hba(info)
if item not in parsed:
return 3, "HBA %s not found in agent output" % item
@@ -121,6 +123,7 @@ def check_emcvnx_hba(item, _no_params, info):
check_info['emcvnx_hba'] = {
+ "parse_function" : parse_emcvnx_hba,
"inventory_function" : inventory_emcvnx_hba,
"check_function" : check_emcvnx_hba,
"service_description" : "HBA %s",