Module: check_mk
Branch: master
Commit: f6428ace9899831a838d9b3d86f66f9aa95fbea5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f6428ace989983…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Oct 28 16:43:25 2014 +0100
#1427 FIX esx_vsphere_hostsystem.multipath: no longer crashes at invalid multipath types
The check had problems (crashed) when processing multipaths elements of the type
<tt>usb.vmhba32-usb.0:0-</tt>.
Those elements are now ignored.
---
.werks/1427 | 11 +++++++++++
ChangeLog | 1 +
checks/esx_vsphere_hostsystem | 6 +++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/1427 b/.werks/1427
new file mode 100644
index 0000000..da838ea
--- /dev/null
+++ b/.werks/1427
@@ -0,0 +1,11 @@
+Title: esx_vsphere_hostsystem.multipath: no longer crashes at invalid multipath types
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414510819
+Class: fix
+
+The check had problems (crashed) when processing multipaths elements of the type
<tt>usb.vmhba32-usb.0:0-</tt>.
+Those elements are now ignored.
+
diff --git a/ChangeLog b/ChangeLog
index e167270..b1761c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -126,6 +126,7 @@
NOTE: Please refer to the migration notes!
* 1161 FIX: fc_port: Fixed invalid values of counters, fixed wrong values in
graphs...
* 1192 FIX: veeam_jobs: Check now recognize sync jobs...
+ * 1427 FIX: esx_vsphere_hostsystem.multipath: no longer crashes at invalid multipath
types...
Multisite:
* 1066 New Dashboard Designer...
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index 4db95de..7b9a57d 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -299,7 +299,11 @@ def esx_vsphere_multipath_convert(info):
data = zip(data[::2], data[1::2])
paths = {}
for path, state in data:
- path_type, path_id = path.split('-')[-1].split('.')
+ path_tokens = path.split('-')
+ if "." not in path_tokens[-1]:
+ continue # invalid format / unknown type
+ path_type, path_id = path_tokens[-1].split('.')
+
if path_type in ['naa', 'eui']:
hw_type = path.split('.')[0]
if hw_type != 'unknown':