mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-22 10:23:46 +01:00
This commit is contained in:
parent
2404d1261f
commit
7e63f6d7b3
@ -40,6 +40,8 @@ username="eva"
|
|||||||
password="eva1234"
|
password="eva1234"
|
||||||
mode="check_systems"
|
mode="check_systems"
|
||||||
path=''
|
path=''
|
||||||
|
nagios_server = None
|
||||||
|
nagios_port = None
|
||||||
|
|
||||||
# No real need to change anything below here
|
# No real need to change anything below here
|
||||||
version="1.0"
|
version="1.0"
|
||||||
@ -134,6 +136,12 @@ while len(arguments) > 0:
|
|||||||
elif arg == '-h' or '--help':
|
elif arg == '-h' or '--help':
|
||||||
print_help()
|
print_help()
|
||||||
exit(ok)
|
exit(ok)
|
||||||
|
elif arg == '--nagioserver':
|
||||||
|
global nagios_server
|
||||||
|
nagios_server = arguments.pop(0)
|
||||||
|
elif arg == '--nagiosport':
|
||||||
|
global nagios_port
|
||||||
|
nagios_port = arguments.pop(0)
|
||||||
else:
|
else:
|
||||||
error( "Invalid argument %s"% arg)
|
error( "Invalid argument %s"% arg)
|
||||||
|
|
||||||
@ -271,10 +279,17 @@ def run_sssu(system=None, command="ls system full"):
|
|||||||
def end(summary,perfdata,longserviceoutput,nagios_state):
|
def end(summary,perfdata,longserviceoutput,nagios_state):
|
||||||
global show_longserviceoutput
|
global show_longserviceoutput
|
||||||
global show_perfdata
|
global show_perfdata
|
||||||
if not show_perfdata: perfdata = ""
|
global nagios_server
|
||||||
print "%s - %s | %s" % (state[nagios_state], summary,perfdata)
|
global nagios_port
|
||||||
|
|
||||||
|
message = "%s - %s" % ( state[nagios_state], summary)
|
||||||
|
if show_perfdata:
|
||||||
|
message = "%s | %s" % ( message, perfdata)
|
||||||
if show_longserviceoutput:
|
if show_longserviceoutput:
|
||||||
print longserviceoutput
|
message = "%s\n%s" % ( message, longserviceoutput)
|
||||||
|
if nagios_server is not None:
|
||||||
|
pass
|
||||||
|
print message
|
||||||
exit(nagios_state)
|
exit(nagios_state)
|
||||||
|
|
||||||
def check_systems():
|
def check_systems():
|
||||||
|
Loading…
Reference in New Issue
Block a user