Page 3 of 5

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 4:02 pm
by aap
Yes that's correct.

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 4:03 pm
by abrist
I ask because it is sent correctly, what does your postfix config look like? It is treating the root account as a local relay, do you have postfix configured for this?

EDIT: Can you send mail from the cli?

Code: Select all

echo "test message" | mail -s "some subject" email@destination

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 4:10 pm
by aap
Hi,

I am very confused here. This had been working well for about 2 years now. The only change was the install of 2012R1.7 after which it stopped working. I made no changes to postfix and I.m not sure how to do that. Is there something I need to check?

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 4:16 pm
by aap
Hi,

Email from the cli does not get delivered either.

However, sending a test notification from NagiosXI delivers successfully.

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 4:19 pm
by abrist
aap wrote: However, sending a test notification from NagiosXI delivers successfully.
Then sendmail is working, and you are experiencing problems with your postfix config.

In your initial setup, did you alter any of the default notification commands? (notifiy-host-by-email, notify-service-by-email, xi-host-notification-handler, xi-service-notification-handler)

Do you have a relay host in your organization that you send all emails through?

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 4:22 pm
by aap
Hi,

We are using your vmware supplied image and no postfix changes were made. How do I check to confirm these settings are what you expect.

We do not use a mail relay

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 4:28 pm
by abrist
What version did you upgrade from? Do you have an old XI configuration snapshot tarball from before the upgrade? XI does not ship using postfix out of the box, as sendmail is the default mail client for XI.

We could check the notification commands to make sure they did not change in the upgrade: Go to XI --> Admin --> Config Snapshots. Click the disk icon next to a snapshot from a date before the upgrade. Open the tarball and browse for: commands.cfg. This file should include the following 4 commands (among) others. Post their contents in a code wrap.

Code: Select all

notifiy-host-by-email
notify-service-by-email
xi-host-notification-handler
xi-service-notification-handler

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 4:40 pm
by aap

Code: Select all

define command {
       command_name                  		notify-host-by-email
       command_line                  		/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}	

define command {
       command_name                  		notify-service-by-email
       command_line                  		/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\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$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}	

define command {
       command_name                  		xi_host_event_handler
       command_line                  		/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_event.php --handler-type=host --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$"
}	

define command {
       command_name                  		xi_host_notification_handler
       command_line                  		/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$"
}	

define command {
       command_name                  		xi_service_event_handler
       command_line                  		/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_event.php --handler-type=service --host="$HOSTNAME$" --service="$SERVICEDESC$" --hostaddress="$HOSTADDRESS$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$"
}	

define command {
       command_name                  		xi_service_notification_handler
       command_line                  		/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"
}	

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 5:04 pm
by aap
Hi,

Does that look okay?

Re: Upgrade to 2012 1.7 stops all email notifications

Posted: Mon Apr 08, 2013 5:36 pm
by aap
It seems as if the last config snapshot I have is after the upgrade was done.

I have old backups and would like to know how to extract the data you would like me to post.