From ecf93a695e4e5351ac7b1ec7c06155527b279761 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 24 Jan 2017 17:57:28 +0000 Subject: [PATCH 1/4] Throw an unknown if we can't fetch the data for some reason --- check_esxi_hardware.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/check_esxi_hardware.py b/check_esxi_hardware.py index cf70e83..1daebb2 100755 --- a/check_esxi_hardware.py +++ b/check_esxi_hardware.py @@ -38,6 +38,7 @@ # Copyright (c) 2015 Andreas Gottwald # Copyright (c) 2015 Stanislav German-Evtushenko # Copyright (c) 2015 Stefan Roos +# Copyright (c) 2017 Peter Newman # # The VMware 4.1 CIM API is documented here: # http://www.vmware.com/support/developer/cim-sdk/4.1/smash/cim_smash_410_prog.pdf @@ -643,6 +644,9 @@ if vendor=='auto': if ( args[1].find('Socket error') >= 0 ): print "UNKNOWN: %s" %args sys.exit (ExitUnknown) + elif ( args[1].find('ThreadPool --- Failed to enqueue request') >= 0 ): + print "UNKNOWN: %s" %args + sys.exit (ExitUnknown) else: verboseoutput("Unknown CIM Error: %s" % args) except pywbem.cim_http.AuthError,arg: From 3566f03ecb38b3205915747041a7579b101ca07e Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 24 Jan 2017 18:06:35 +0000 Subject: [PATCH 2/4] SPaG --- check_esxi_hardware.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_esxi_hardware.py b/check_esxi_hardware.py index 1daebb2..6a7400a 100755 --- a/check_esxi_hardware.py +++ b/check_esxi_hardware.py @@ -808,11 +808,11 @@ for classe in ClassesToCheck : 30 : ExitCritical, # Non-recoverable Error }[elementStatus] if (interpretStatus == ExitCritical) : - verboseoutput("GLobal exit set to CRITICAL") + verboseoutput("Global exit set to CRITICAL") GlobalStatus = ExitCritical ExitMsg += " CRITICAL : %s " % elementNameValue if (interpretStatus == ExitWarning and GlobalStatus != ExitCritical) : - verboseoutput("GLobal exit set to WARNING") + verboseoutput("Global exit set to WARNING") GlobalStatus = ExitWarning ExitMsg += " WARNING : %s " % elementNameValue # Added the following for when GlobalStatus is ExitCritical and a warning is detected @@ -863,7 +863,7 @@ for classe in ClassesToCheck : GlobalStatus = ExitCritical ExitMsg += " CRITICAL : %s " % elementNameValue if (interpretStatus == ExitWarning and GlobalStatus != ExitCritical) : - verboseoutput("GLobal exit set to WARNING") + verboseoutput("Global exit set to WARNING") GlobalStatus = ExitWarning ExitMsg += " WARNING : %s " % elementNameValue # Added same logic as in 20100702 here, otherwise Dell servers would return UNKNOWN instead of OK From db0ffb7a05d74217d908a825c1f0178319e6c67b Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 25 Jan 2017 10:48:19 +0000 Subject: [PATCH 3/4] Throw another unknown if we can't fetch the data elsewhere for some reason --- check_esxi_hardware.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/check_esxi_hardware.py b/check_esxi_hardware.py index 6a7400a..5213db4 100755 --- a/check_esxi_hardware.py +++ b/check_esxi_hardware.py @@ -646,7 +646,7 @@ if vendor=='auto': sys.exit (ExitUnknown) elif ( args[1].find('ThreadPool --- Failed to enqueue request') >= 0 ): print "UNKNOWN: %s" %args - sys.exit (ExitUnknown) + sys.exit (ExitUnknown) else: verboseoutput("Unknown CIM Error: %s" % args) except pywbem.cim_http.AuthError,arg: @@ -675,6 +675,9 @@ for classe in ClassesToCheck : if ( args[1].find('Socket error') >= 0 ): print "UNKNOWN: %s" %args sys.exit (ExitUnknown) + elif ( args[1].find('ThreadPool --- Failed to enqueue request') >= 0 ): + print "UNKNOWN: %s" %args + sys.exit (ExitUnknown) else: verboseoutput("Unknown CIM Error: %s" % args) except pywbem.cim_http.AuthError,arg: From 21e0c2b3eda057d950b27f0b28444185ef7e0a46 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 10 Apr 2018 14:37:18 +0100 Subject: [PATCH 4/4] Fix a whitespace issue --- check_esxi_hardware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_esxi_hardware.py b/check_esxi_hardware.py index 0a3467a..e00d926 100755 --- a/check_esxi_hardware.py +++ b/check_esxi_hardware.py @@ -723,7 +723,7 @@ for classe in ClassesToCheck : # Ignore element if we don't want it if elementName in ignore_list : verboseoutput(" (ignored)") - continue + continue # BIOS & Server info if elementName == 'System BIOS' :