Only notify-service-by-email not working
Posted: Fri Dec 27, 2013 4:01 pm
I've run into an interesting problem using Nagios 3.5.1. The notify-host-by-email command works just fine, but notify-service-by-email doesn't even run the specified command line. No error is thrown or logged, it just silently goes nowhere. This is all I see in the logs:
The command definitions for both are very similar:
The /usr/sbin/nagmail is a perl wrapper that I built to give me more control over debugging, SMTP settings, etc. But it isn't even being run when notify-service-by-email is called. I've confirmed that by having the script write a file each time it runs (whether it works or not), and that file is only written when Nagios calls notify-host-by-email.
Any ideas? I'm running under CentOS 6.5, using Nagios 3.5.1 from the EPEL yum repository.
Code: Select all
[1388177492] EXTERNAL COMMAND: SEND_CUSTOM_SVC_NOTIFICATION;artsci;http;3;michael;Testing notification
[1388177492] SERVICE NOTIFICATION: ops;artsci;http;CUSTOM (OK);notify-service-by-email;HTTP OK: HTTP/1.0 200 OK - 31151 bytes in 0.030 second response time;michael;Testing notification
Code: Select all
define command{
command_name notify-host-by-email
command_line /usr/sbin/nagmail --atype host --caddr $CONTACTEMAIL$ --ntype $NOTIFICATIONTYPE$ --hname $HOSTNAME$ --hstate $HOSTSTATE$ --haddr $HOSTADDRESS$ --hout $HOSTOUTPUT$ --ldtime $LONGDATETIME$
}
define command{
command_name notify-service-by-email
command_line /usr/sbin/nagmail --atype service --caddr $CONTACTEMAIL$ --ntype $NOTIFICATIONTYPE$ --sdesc $SERVICEDESC$ --halias $HOSTALIAS$ --sstate $SERVICESTATE$ --haddr $HOSTADDRESS$ --ldtime $LONGDATETIME$ --sout $SERVICEOUTPUT$
}
Any ideas? I'm running under CentOS 6.5, using Nagios 3.5.1 from the EPEL yum repository.