Page 1 of 2

Host/service notification emails not working

Posted: Tue Nov 07, 2017 11:37 am
by GldRush98
Send test emails: work
Account creation emails: work
Sending at shell as nagios user: work
Host/service notification emails: NOT WORKING

This is a brand new vmware image of 5.4.10 (upgraded to 5.4.11) centos6. Email notifications are not sending out of the system.

nagios.log shows notifications being issued:

Code: Select all

[1510070982] SERVICE ALERT: GCC-DC01;Print Spooler TEST;OK;HARD;2;Spooler: Started
[1510070982] SERVICE NOTIFICATION: nicktest;GCC-DC01;Print Spooler TEST;OK;xi_service_notification_handler;Spooler: Started
[1510071639] SERVICE ALERT: GCC-DC01;Print Spooler TEST;CRITICAL;SOFT;1;Spooler: Stopped
[1510071649] SERVICE ALERT: GCC-DC01;Print Spooler TEST;CRITICAL;HARD;2;Spooler: Stopped
[1510071649] SERVICE NOTIFICATION: nicktest;GCC-DC01;Print Spooler TEST;CRITICAL;xi_service_notification_handler;Spooler: Stopped
But the debug log shows them never hitting the system to actually send out. I see the tests and the account creation messages though! phpmailer.log:

Code: Select all

[11-07-2017 10:04:54] Message sent! (method=sendmail), Referer: admin/testemail.php
[11-07-2017 10:08:51] Message sent! (method=sendmail), Referer: admin/users.php > Account Creation
[11-07-2017 10:28:39] Message sent! (method=sendmail), Referer: account/testnotification.php > PHPmailer Test
I even tried changing the email method from Sendmail to SMTP... exact same thing happens. Tests work, notifications don't.
I've checked postfix settings compared to a working system, and no remarkable differences.

I've been up and down all the settings and I can't find anything I'm missing. I've set up many XI systems before and have never ran in to a problem like this. I keep thinking there is something obvious, but like I said, I've been up and down the settings and don't know what else to troubleshoot at this point. Help :(

Re: Host/service notification emails not working

Posted: Tue Nov 07, 2017 12:04 pm
by npolovenko
@GldRush98, let's make sure that all the right settings are enabled first.
Click on the username in top right corner of the web interface. Then notification methods in the left column and make sure that Receive alerts via emailoption is enabled. Also, click on notification preferences and make sure that notifications are enabled there as well. Check what types of alerts you'd like to receive as well and click on update settings.

Here's the reference: https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Host/service notification emails not working

Posted: Tue Nov 07, 2017 1:13 pm
by GldRush98
Been there, done that. Looked at those pages a dozen times already...

Re: Host/service notification emails not working

Posted: Tue Nov 07, 2017 2:35 pm
by dwasswa
Hi @ GldRush98,

Please run the following command...tail -f /usr/local/nagiosxi/var/eventman.log

This command can be used to watch the logs related to events and notifications in Nagios XI.

As you run that command, force an immediate check by clicking on service that is in an Warning or Critical state, then watch the logs and post the output.

See steps below:

Step 1: Establish terminal session and run command
Watch_logs.PNG
Step 2: Go to Service Detail menu and click on a Warning or Critical service.
Select_service.PNG

Step 3: On the Service Status Detail page for that service, click on Force an immediate check to the right under the Quick Actions options.
Force_check.PNG
Step 4: Watch the logs for at least 30 seconds and then post the output.

Re: Host/service notification emails not working

Posted: Tue Nov 07, 2017 2:55 pm
by GldRush98
Ok, I forced an immediate check and waited... PROCESSED 0 EVENTS
I changed the state of the service from Critical -> Good and forced a check and waited. PROCESSED 0 EVENTS
I don't see anything other than 0 events through this time. It's been several minutes... Problem?

Code: Select all

[nagios@nagios root]$ tail -f /usr/local/nagiosxi/var/eventman.log
PROCESSED 0 EVENTS
....................
PROCESSED 0 EVENTS
.....................
PROCESSED 0 EVENTS
....................
PROCESSED 0 EVENTS
...................
PROCESSED 0 EVENTS
.....................
PROCESSED 0 EVENTS
...................
PROCESSED 0 EVENTS
.....................
PROCESSED 0 EVENTS
...................

Re: Host/service notification emails not working

Posted: Tue Nov 07, 2017 3:28 pm
by GldRush98
::rubseyes:: The forum has changed before my very eyes :shock:

Re: Host/service notification emails not working

Posted: Tue Nov 07, 2017 5:35 pm
by tgriep
Can you run the following as root and post the /tmp/info.txt file?

Code: Select all

echo 'select * from xi_events;' |mysql -t -u root -pnagiosxi nagiosxi >/tmp/info.txt
echo 'select * from xi_eventqueue;' |mysql -t -u root -pnagiosxi nagiosxi >>/tmp/info.txt
echo 'desc xi_events;' |mysql -t -u root -pnagiosxi nagiosxi >>/tmp/info.txt
echo 'desc xi_eventqueue;' |mysql -t -u root -pnagiosxi nagiosxi >>/tmp/info.txt
ps -ef --cols=300 >>/tmp/info.txt
tail -50 /usr/local/nagiosxi/tmp/phpmailer.log  >>/tmp/info.txt
Just want to check to see if the MYSQL tables are setup correctly and that there is not any corrupted data causing them to not send.

Also, go to the Admin > Monitoring Engine Status menu and make sure notifications are enabled in the Monitoring Engine Process dashlet.

Re: Host/service notification emails not working

Posted: Tue Nov 07, 2017 5:56 pm
by GldRush98
The first 2 select queries were empty (nothing returned).
Notifications are enabled from monitoring engine status.

Info txt file attached.

Re: Host/service notification emails not working

Posted: Wed Nov 08, 2017 9:52 am
by tgriep
Thanks for the file. Everything looks good in it.
Can you upload a or PM me your System Profile as well as the following log files?

Code: Select all

/usr/local/nagiosxi/var/event_handler.log
/usr/local/nagiosxi/var/eventman.log
To post your system profile. Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and upload it to the post or PM it to me.

Thanks

Re: Host/service notification emails not working

Posted: Wed Nov 08, 2017 10:39 am
by GldRush98
Ok, PM sent. This was a vmware image from the Nagios site from a couple weeks ago, and it's had almost nothing done on it but some basic set up, so not sure what happened.