Upgrade to 2012 1.7 stops all email notifications

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Upgrade to 2012 1.7 stops all email notifications

Post by aap »

Yes that's correct.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrade to 2012 1.7 stops all email notifications

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Upgrade to 2012 1.7 stops all email notifications

Post 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?
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Upgrade to 2012 1.7 stops all email notifications

Post by aap »

Hi,

Email from the cli does not get delivered either.

However, sending a test notification from NagiosXI delivers successfully.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrade to 2012 1.7 stops all email notifications

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Upgrade to 2012 1.7 stops all email notifications

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrade to 2012 1.7 stops all email notifications

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Upgrade to 2012 1.7 stops all email notifications

Post 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$"
}	
Last edited by sreinhardt on Mon Apr 08, 2013 4:49 pm, edited 1 time in total.
Reason: cleaned up file to show only what we need.
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Upgrade to 2012 1.7 stops all email notifications

Post by aap »

Hi,

Does that look okay?
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Upgrade to 2012 1.7 stops all email notifications

Post 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.
Last edited by aap on Tue Apr 09, 2013 3:14 am, edited 1 time in total.
Locked