global_event_handler and macros.
Posted: Sun Feb 12, 2012 4:52 am
Hello everyone,
I've been following Askar Ali Khan's guide to sending snmp traps via nagios.
SNMP traps are sent and everything is fine, but one issue - the $HOSTADDRESS$ macro sometimes outputs the actual IP address, which is great, but sometimes it outputs the host name instead of the address. There are no visible common attributes between the checks, as far as I have seen.
Relevant configuration snippets:
checkcommands.cfg
nagios.cfg
Any hint will be greatly appreciated, I have been looking at this matter for over two days now, with no useful leads..
Thanks in advance!
I've been following Askar Ali Khan's guide to sending snmp traps via nagios.
SNMP traps are sent and everything is fine, but one issue - the $HOSTADDRESS$ macro sometimes outputs the actual IP address, which is great, but sometimes it outputs the host name instead of the address. There are no visible common attributes between the checks, as far as I have seen.
Relevant configuration snippets:
checkcommands.cfg
Code: Select all
# 'send-service-trap' command definition
define command{
command_name send-service-trap
command_line /usr/local/bin/send-service-trap hostname public "$HOSTADDRESS$" "$SERVICEDESC$" $SERVICESTATEID$ "$SERVICEOUTPUT$"
}
# 'send-host-trap' command definition
define command{
command_name send-host-trap
command_line /usr/local/bin/send-host-trap hostname public "$HOSTADDRESS$" $HOSTSTATEID$ "$HOSTOUTPUT$"
}
nagios.cfg
Code: Select all
global_host_event_handler=send-host-trap
global_service_event_handler=send-service-trap
Thanks in advance!