mirror of
https://github.com/Napsty/check_esxi_hardware.git
synced 2024-11-22 02:13:46 +01:00
check_esxi_hardware.py: unknown instead of crit
Set status to unknown instead of critical for timeouts, authentication errors and such things as those issues are critical for the check itself but not for the service.
This commit is contained in:
parent
8aecf4e7d1
commit
e3a43a5dd0
@ -565,8 +565,8 @@ if os_platform != "win32":
|
|||||||
on_windows = False
|
on_windows = False
|
||||||
import signal
|
import signal
|
||||||
def handler(signum, frame):
|
def handler(signum, frame):
|
||||||
print 'CRITICAL: Execution time too long!'
|
print 'UNKNOWN: Execution time too long!'
|
||||||
sys.exit(ExitCritical)
|
sys.exit(ExitUnknown)
|
||||||
|
|
||||||
# connection to host
|
# connection to host
|
||||||
verboseoutput("Connection to "+hosturl)
|
verboseoutput("Connection to "+hosturl)
|
||||||
@ -619,13 +619,13 @@ for classe in ClassesToCheck :
|
|||||||
instance_list = wbemclient.EnumerateInstances(classe)
|
instance_list = wbemclient.EnumerateInstances(classe)
|
||||||
except pywbem.cim_operations.CIMError,args:
|
except pywbem.cim_operations.CIMError,args:
|
||||||
if ( args[1].find('Socket error') >= 0 ):
|
if ( args[1].find('Socket error') >= 0 ):
|
||||||
print "CRITICAL: %s" %args
|
print "UNKNOWN: %s" %args
|
||||||
sys.exit (ExitCritical)
|
sys.exit (ExitUnknown)
|
||||||
else:
|
else:
|
||||||
verboseoutput("Unknown CIM Error: %s" % args)
|
verboseoutput("Unknown CIM Error: %s" % args)
|
||||||
except pywbem.cim_http.AuthError,arg:
|
except pywbem.cim_http.AuthError,arg:
|
||||||
verboseoutput("Global exit set to UNKNOWN")
|
verboseoutput("Global exit set to UNKNOWN")
|
||||||
GlobalStatus = ExitCritical
|
GlobalStatus = ExitUnknown
|
||||||
print "UNKNOWN: Authentication Error"
|
print "UNKNOWN: Authentication Error"
|
||||||
sys.exit (GlobalStatus)
|
sys.exit (GlobalStatus)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user