mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-22 10:23:46 +01:00
system name added to phone_home options
This commit is contained in:
parent
b07d99699e
commit
87b137f762
@ -308,6 +308,7 @@ def end(summary,perfdata,longserviceoutput,nagios_state):
|
|||||||
global hostname
|
global hostname
|
||||||
global mode
|
global mode
|
||||||
global escape_newlines
|
global escape_newlines
|
||||||
|
global check_system
|
||||||
|
|
||||||
message = "%s - %s" % ( state[nagios_state], summary)
|
message = "%s - %s" % ( state[nagios_state], summary)
|
||||||
if show_perfdata:
|
if show_perfdata:
|
||||||
@ -321,7 +322,7 @@ def end(summary,perfdata,longserviceoutput,nagios_state):
|
|||||||
if do_phone_home == True:
|
if do_phone_home == True:
|
||||||
try:
|
try:
|
||||||
if nagios_myhostname == None: nagios_myhostname = hostname
|
if nagios_myhostname == None: nagios_myhostname = hostname
|
||||||
phone_home(nagios_server,nagios_port, status=nagios_state, message=message, hostname=nagios_myhostname, servicename=mode)
|
phone_home(nagios_server,nagios_port, status=nagios_state, message=message, hostname=nagios_myhostname, servicename=mode,system=check_system)
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
print message
|
print message
|
||||||
@ -341,8 +342,9 @@ class ProxiedTransport(xmlrpclib.Transport):
|
|||||||
|
|
||||||
|
|
||||||
''' phone_home: Sends results to remote nagios server via python xml-rpc '''
|
''' phone_home: Sends results to remote nagios server via python xml-rpc '''
|
||||||
def phone_home(nagios_server,nagios_port, status, message, hostname=None, servicename=None):
|
def phone_home(nagios_server,nagios_port, status, message, hostname=None, servicename=None,system=None):
|
||||||
debug("phoning home: %s" % (servicename) )
|
debug("phoning home: %s" % (servicename) )
|
||||||
|
servicename = str(servicename) + str(system)
|
||||||
uri = "http://%s:%s" % (nagios_server,nagios_port)
|
uri = "http://%s:%s" % (nagios_server,nagios_port)
|
||||||
|
|
||||||
global proxyserver
|
global proxyserver
|
||||||
|
Loading…
Reference in New Issue
Block a user