Module: check_mk
Branch: master
Commit: 3b97dbf185a8779ea5a90a8318a9b89b8cb9e780
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3b97dbf185a877…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Nov 25 10:49:02 2015 +0100
#2802 esx_vsphere_hostsystem.multipath: now supports ESX 6.0 multipath names
---
.werks/2802 | 9 +++++++++
ChangeLog | 1 +
checks/esx_vsphere_hostsystem | 18 ++++++++++++++++--
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/.werks/2802 b/.werks/2802
new file mode 100644
index 0000000..9c47b3e
--- /dev/null
+++ b/.werks/2802
@@ -0,0 +1,9 @@
+Title: esx_vsphere_hostsystem.multipath: now supports ESX 6.0 multipath names
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1448444844
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index fbba25e..3ac34fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* 2797 netscaler_vserver: now also shows tftp servers and health state of
loadbalacing entities
* 2863 wagner_titanus_topsens: added support for more devices...
* 2801 snmp text encoding: now able to decode cp437 encoded snmp strings...
+ * 2802 esx_vsphere_hostsystem.multipath: now supports ESX 6.0 multipath names
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index 1b0e5dd..acc3aeb 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -374,6 +374,14 @@ def esx_vsphere_multipath_convert(info):
data = zip(data[::2], data[1::2])
paths = {}
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])
+ paths.setdefault(real_path, [])
+ # Note: There is no path type information available in these esx paths
+ paths[real_path].append((state, None))
+ continue
+
path_tokens = path.split('-')
if "." not in path_tokens[-1]:
continue # invalid format / unknown type
@@ -384,6 +392,7 @@ def esx_vsphere_multipath_convert(info):
if hw_type != 'unknown':
paths.setdefault(path_id, [])
paths[path_id].append((state, "%s/%s" % (path_type, hw_type)))
+
return paths
def inventory_esx_vsphere_hostsystem_multipath(info):
@@ -445,9 +454,14 @@ def check_esx_vsphere_hostsystem_multipath(item, params, info):
state_values[2] = "(!)(more than %d)" % warn_max
# Output message
- message = "Type %s" % path_type
+ message = ""
+ if path_type:
+ message += "Type %s, " % path_type
+
+ element_text = []
for element in "active", "dead", "disabled",
"standby", "unknown":
- message += ", %d %s%s" % ( state_infos[element][1], element,
state_infos[element][2] )
+ element_text.append("%d %s%s" % ( state_infos[element][1],
element, state_infos[element][2]))
+ message += ", ".join(element_text)
break
else:
return 3, "Path not found in agent output"