Hoping that my Obi Wan is here as I'm pulling my hair out here.
I have Nagios 3.4.1 running Ubuntu Server 13.04. I have postfix service installed. (I have changed the email address below to a generic one but the real one works)
I originally set the commands.cfg email to be as below as I was testing everything, but now I need this to go to different people depending on the fault. I have also tried using contact_groups too.
this sent out email perfectly fine, but now we're nearly ready to go live, I've created the contacts.cfg with the appropriate informationcommand_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" notification@domain.com
In the service check, I usedefine contact{
contact_name ita
alias analysts
host_notifications_enabled 1
service_notifications_enabled 1
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r,u
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email notification@domain.com
}
in the definitioncontacts ita
In the nagios log, I only ever see
I've been looking and checked that all the macro names have a $ at each end. I'm absolutely stuck as looking on the web and here I see that some remove the end $, some put it in " or '.[1375353854] HOST ALERT: BLC_Switch;DOWN;HARD;1;Unreachable
[1375353854] HOST NOTIFICATION: root;BLC_Switch;DOWN;notify-host-by-email;Unreachable
Please - help me Obi Wan, you're my only hope.