Page 1 of 1

Email Notifications Not Arriving After Upgrade

Posted: Wed Jul 26, 2017 12:25 pm
by JNelson
(Moved from the General Support forum)

Hi,

I upgraded our Nagios XI 2014R2 to 5.4.7 last night, and now email notifications aren't arriving correctly. This was working properly before the upgrade. The logs show that emails are being sent.
[1501071308] SERVICE NOTIFICATION: USERNAME;IT06010;Port Usage Errors Discards;OK;xi_service_notification_handler;SERVICE:UP (0.4%/0.0%/0.0/0.0/0.0/0.0), SERVICE:UP (2.8%/39.7%/0.0/0.0/0.0/2.9), SERVICE:UP (0.0%/0.0%/0.0/0.0/0.0/0.0):3 UP: OK
However, the /var/log/maillog shows no attempt to send email. Logging in as the "nagios" user and sending the following command works correctly.

Code: Select all

/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$ **" [email protected]
Within the Web GUI, if I "Send Test Notification" to myself, it advances to a blank page, and again, nothing in maillog and no email arrives.

Running RHEL updates did appear to reset the postfix configuration to default. However, I changed the relay host, and it works from the command line again. Since it's not even hitting the logs, I think it may be a separate issue, possibly on the Nagios side.

Could someone please assist me in troubleshooting this issue?

Re: Email Notifications Not Arriving After Upgrade

Posted: Wed Jul 26, 2017 2:18 pm
by lmiltchev
How many of the monitoring contacts are having issues with notifications - one, some, all? Are they "contacts only" or "xi users"? They are not the same. For more information on the topic, review the document below:
https://assets.nagios.com/downloads/nag ... ntacts.pdf

Did you use custom (modified) notification handlers prior to the upgrade?

The command that you tested (that worked) is the "notify-host-by-email" command, which is typically used by "contacts only". The notification from the log shows "xi_service_notification_handler", which is normally used by "xi users". It's possible that for some reason notifications stopped working for users. In order to start troubleshooting, please follow all of the steps, outlined in our "Nagios XI - Notification Problems" document here:
https://support.nagios.com/kb/article/n ... blems.html

Does the "/usr/local/nagiosxi/tmp/phpmailer.log" exist on your system? If it does, can you post it?

Re: Email Notifications Not Arriving After Upgrade

Posted: Wed Jul 26, 2017 3:35 pm
by JNelson
The following error was in the log file "/usr/local/nagiosxi/tmp/phpmailer.log".
PHP Fatal error: Call to undefined function mb_convert_encoding() in /usr/local/nagiosxi/html/includes/utils-email.inc.php on line 81
This lead me to realize that the package "php-mbstring" had been uninstalled as part of a large yum update I did before the migration. Once I installed the package, a flood of backlogged emails started flowing. The issue is now resolved. Thanks for your help.

Re: Email Notifications Not Arriving After Upgrade

Posted: Wed Jul 26, 2017 3:44 pm
by bolson
Is it ok if we close this topic?

Re: Email Notifications Not Arriving After Upgrade

Posted: Wed Jul 26, 2017 3:49 pm
by JNelson
Yes, go ahead. Thanks again.

Re: Email Notifications Not Arriving After Upgrade

Posted: Wed Jul 26, 2017 3:50 pm
by bolson
Closing topic as resolved.

Thank you for using the Nagios Support Forum.