mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-22 10:23:46 +01:00
make sure plugin exits cleanly if unable to run clustat -fx command
This commit is contained in:
parent
5cdbba7b66
commit
ceda55b389
@ -120,9 +120,12 @@ def main():
|
|||||||
usage()
|
usage()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
try:
|
||||||
clustatOutput = os.popen('/usr/sbin/clustat -fx')
|
clustatOutput = os.popen('/usr/sbin/clustat -fx')
|
||||||
dom = xml.dom.minidom.parse(clustatOutput)
|
dom = xml.dom.minidom.parse(clustatOutput)
|
||||||
|
except Exception, e:
|
||||||
|
print "Error: could not parse output of : '/usr/sbin/clustat -fx': ", e
|
||||||
|
sys.exit(3)
|
||||||
if typeCheck == 'cluster':
|
if typeCheck == 'cluster':
|
||||||
|
|
||||||
# First we query for the state of the cluster itself.
|
# First we query for the state of the cluster itself.
|
||||||
|
Loading…
Reference in New Issue
Block a user