Module: check_mk
Branch: master
Commit: 6deae9e85c6687bbb9d4eb9656384b3d22ea119f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6deae9e85c6687…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Tue Feb 14 09:54:42 2017 +0100
4194 FIX esx_vsphere_hostsystem.multipath: Fixed grouping of paths
The changes in vSphere6 made it impossible to display the data in the known way. Now
it's necessary to display the information as L#. Additionally there is a suffix to
identify the type of the LUN correctly. Otherwise the path to a pseudo-logical device like
USB sticks could be accidentally added to the paths of a SAN-LUN.
A rediscovery will be necessary since this fix will change the Service Description!
Change-Id: If5e2ae3e1c8e54948f10fb1e16c1e5b776fc61b5
---
.werks/4194 | 11 +++++++++++
checks/esx_vsphere_hostsystem | 17 ++++++++++++++++-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/.werks/4194 b/.werks/4194
new file mode 100644
index 0000000..6ac9baf
--- /dev/null
+++ b/.werks/4194
@@ -0,0 +1,11 @@
+Title: esx_vsphere_hostsystem.multipath: Fixed grouping of paths
+Level: 2
+Component: checks
+Compatible: incomp
+Version: 1.4.0i4
+Date: 1487062070
+Class: fix
+
+The changes in vSphere6 made it impossible to display the data in the known way. Now
it's necessary to display the information as L#. Additionally there is a suffix to
identify the type of the LUN correctly. Otherwise the path to a pseudo-logical device like
USB sticks could be accidentally added to the paths of a SAN-LUN.
+
+A rediscovery will be necessary since this fix will change the Service Description!
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index 881a4e1..eba4699 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -399,7 +399,22 @@ def esx_vsphere_multipath_convert(info):
for path, state in data:
# ESX 6.0 uses a different format, e.g "vmhba32:C0:T0:L0 active"
if len(path.split(":")) == 4:
- real_path = ":".join(path.split(":")[:3])
+ hba_num = int(path.split(":")[0].replace("vmhba",
""))
+ real_path = path.split(":")[-1]
+
+ # vmware specificies three different types of LUNs. Physical LUNs will
+ # reserves vmhba number 0-31. The other two reserve numbers of base64.
+ # The lower 32 range is reserved for pseudo logical LUNs. The upper 32
+ # for logical LUNs. e.g. 32-63 for pseudo logical LUNs like USB and
+ # 64-95 for logical LUNs like iSCSI.
+ # These should be added as different multipath LUNs.
+ if hba_num >= 32 and hba_num % 64 < 33:
+ real_path = "%s pseudo-logical" % real_path
+ elif hba_num >= 32 and hba_num % 64 > 32:
+ real_path = "%s logical" % real_path
+ else:
+ real_path = "%s physical" % real_path
+
paths.setdefault(real_path, [])
# Note: There is no path type information available in these esx paths
paths[real_path].append((state, None))