Module: check_mk
Branch: master
Commit: 6ef77db9d4275494a4796ff61604fc33882b3011
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6ef77db9d42754…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Apr 24 17:17:03 2017 +0200
4638 FIX esx_vsphere_hostsystem.multipath: Fixed compatibility to older versions
Some older versions of vsphere could have some unusual multipath syntax in
output which lead into a crash. This is now fixed.
Change-Id: I438b49cfb0f8ad6c6d6e7faf3d177ef3bd677517
---
.werks/4638 | 11 +++++++++++
checks/esx_vsphere_hostsystem | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/4638 b/.werks/4638
new file mode 100644
index 0000000..ce7a980
--- /dev/null
+++ b/.werks/4638
@@ -0,0 +1,11 @@
+Title: esx_vsphere_hostsystem.multipath: Fixed compatibility to older versions
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1493046828
+Class: fix
+
+Some older versions of vsphere could have some unusual multipath syntax in
+output which lead into a crash. This is now fixed.
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index c91e82b..ac305f4 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -398,7 +398,7 @@ def esx_vsphere_multipath_convert(info):
data = zip(data[::2], data[1::2])
for path, state in data:
# vSphere6 uses a different format, e.g "vmhba32:C0:T0:L0 active"
- if len(path.split(":")) == 4:
+ if len(path.split(":")) == 4 and path.startswith("vmhba"):
hba_num = int(path.split(":")[0].replace("vmhba",
""))
lun_id = path.split(":")[-1]