I’m using Nagios 2.0b4 and I’ve had service notifications working, but I stopped getting them several weeks ago and I’m not sure why. I moved from a monolithic config file to several template based configuration files around the same time so maybe something got mixed up in the transmission. Maybe something else went wrong, but either way I’m hoping fresh eyes will help find the problem.
When watching the logs and turning off a sample service, I can see the service checks fail 3 times as per max_check_attempts, but no notifications are logged and none get sent out, though the Service Details page within the web interface shows the failed service as critical.
A sample check is included here:
use generic-service ; Name of service
The contact group is:
alias Nagios test
The contact adam is specified as:
email [email protected]
The service notification commands are (apologies for any linewrapping added, all commands are on one line in the cfg):
command_line /usr/bin/printf “%b” “***** Nagios ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
command_line /bin/echo “Nagios Service $NOTIFICATIONTYPE$: $SERVICEDESC$ on $HOSTALIAS$ $HOSTADDRESS$ is $SERVICESTATE$ $SHORTDATETIME$” | /usr/local/bin/gnokii --sendsms $CONTACTPAGER$
The host is specified as:
use generic-host ; Name of host template to use
I am confused. Host notifications still work fine. Host and service notifications are turned on in nagios.cfg and I have read the notifications FAQ, but maybe I missed something.
Can anyone see where I have gone wrong? I would be very grateful.