Skip to content

Commit

Permalink
Merge pull request #21 from peternewman/master
Browse files Browse the repository at this point in the history
Throw an unknown if we can't fetch the data for some reason
  • Loading branch information
Napsty authored Apr 11, 2018
2 parents 277206a + 21e0c2b commit 413dac7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion check_esxi_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -669,6 +670,9 @@ def handler(signum, frame):
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:
Expand Down Expand Up @@ -697,6 +701,9 @@ def handler(signum, frame):
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:
Expand All @@ -716,7 +723,7 @@ def handler(signum, frame):
# Ignore element if we don't want it
if elementName in ignore_list :
verboseoutput(" (ignored)")
continue
continue

# BIOS & Server info
if elementName == 'System BIOS' :
Expand Down

0 comments on commit 413dac7

Please sign in to comment.