mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-12-25 18:43:52 +01:00
Added a safeguard and print usage when no argument given
This commit is contained in:
parent
ca07c14132
commit
77be9cb42d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user