ignore local disks
Message-ID: <5178ea56.SozLw09pUN+MRYxG%mk(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: e03d49c2b30cd530c74661cbf57e4eeba7993047
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e03d49c2b30cd5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 25 10:33:22 2013 +0200
esx_vsphere_hostsystem.multipath: ignore local disks
---
checks/esx_vsphere_hostsystem | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index 3f10e9c..27ef457 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -218,9 +218,10 @@ def esx_vsphere_multipath_convert(info):
for path, state in data:
path_type, path_id = path.split('-')[-1].split('.')
if path_type in ['naa', 'eui']:
- paths.setdefault(path_id, [])
- path_type = "%s/%s" % (path_type, path.split('.')[0])
- paths[path_id].append((state, path_type))
+ hw_type = path.split('.')[0]
+ 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):
@@ -265,7 +266,12 @@ def check_esx_vsphere_hostsystem_multipath(item, params, info):
unknown += 1
message = "Type %s, %d active, %d dead%s, %d disabled%s, %d standby%s,
%s unknown%s" % \
- (path_type, active, dead, dead_label, disabled, disabled_label, standby,
standby_label, unknown, unknow_label )
+ (path_type, active, dead, dead_label, disabled, disabled_label,
+ standby, standby_label, unknown, unknow_label )
+ break
+ else:
+ return 3, "Path not found in agent output"
+
return (state, message)
check_info['esx_vsphere_hostsystem.multipath'] = {