1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-05 10:03:45 +01:00

Added a safeguard and print usage when no argument given

This commit is contained in:
Denis GERMAIN 2016-12-04 12:20:06 +01:00
parent ca07c14132
commit 77be9cb42d

View File

@ -110,6 +110,7 @@ def main():
sys.exit(2)
check_suspend = False
typeCheck = None
for o, a in opts:
if o in ('-c', '--cluster'):
typeCheck = 'cluster'
@ -122,6 +123,10 @@ def main():
usage()
sys.exit()
if typeCheck == None:
usage()
sys.exit()
try:
clustatOutput = os.popen('/usr/sbin/clustat -fx')
dom = xml.dom.minidom.parse(clustatOutput)