Page 1 of 1

Should I see nagios XI alerts come through /var/log/maillog?

Posted: Tue Nov 01, 2016 9:18 am
by linuser
I'm running Nagios XI core 4.0.8 on CentOS 6.5. I'm seeing my host notifications come through /var/log/messages but I'm not getting the email.

Code: Select all

Nov  1 08:57:51 monitor nagios: HOST NOTIFICATION: sysadmins;server.com;DOWN;xi_host_notification_handler;CRITICAL - server.com: rta nan, lost 100%
My contacts.cfg file looks like this for the contact name and the contact name is correct in the host and service cfg file.

Code: Select all

define contact {
        contact_name                            sysadmins
        alias                                          Sysadmins
        host_notification_period                my_notification_times
        service_notification_period             my_notification_times
        host_notification_options               d,u,r,f,s
        service_notification_options            w,u,c,r,f,s
        email                                   [email protected]
        use                                     xi_contact_generic
        }
In trying to troubleshoot I am checking /var/log/maillog but not seeing anything come through. Just a bit of background here alerts were working before. I did make some changes although nagios did verify the new config. The changes I made consisted of the following:

1) moved a host.cfg file into the /static folder under a new "hosts" folder.
2) Moved a services.cfg file into the /static folder under a new "services" folder.

And of course the emails I should be getting are for the hosts that I moved. My goal was to manage this one server without updates overwritng the changes. Since the host notification is showing in the logs with the correct contact name what else can I do to check the server to see if the emails are actually going out?

Re: Should I see nagios XI alerts come through /var/log/mail

Posted: Tue Nov 01, 2016 10:13 am
by linuser
I moved the files out of /static and back to the original location. Restarted nagios and now I can also see a notification in /var/log/maillog.

Code: Select all

Nov  1 09:41:27 monitor postfix/cleanup[10559]: 5776C1DA: message-id=<[email protected]>
Nov  1 09:41:27 monitor postfix/qmgr[1746]: 5776C1DA: from=<[email protected]>, size=458, nrcpt=1 (queue active)
Nov  1 09:41:30 monitor postfix/smtp[10561]: 5776C1DA: to=<[email protected]>, relay=relayserver.com[x.x.x.x]:25, delay=2.8, delays=0.08/0.05/2.2/0.47, dsn=2.0.0, status=sent (250 ok:  Message 24650461 accepted)
So apparently I did not have something set up right when using the /static folder. However, I still did not receive the email. I can however send one from CLI. Something like this works and I get the email. I'm stumped.

Code: Select all

echo "test" | mailx -s "test" [email protected]

Re: Should I see nagios XI alerts come through /var/log/mail

Posted: Tue Nov 01, 2016 1:20 pm
by tmcdonald
Can you please confirm what product/version you are using? Core and XI are separate products, but XI uses Core under the hood.

Re: Should I see nagios XI alerts come through /var/log/mail

Posted: Tue Nov 01, 2016 2:33 pm
by linuser
Nagios XI 2014R2.6.

I have this partially working now. I needed to create a user that matched the contact name. Once I did that, I started to receive alerts. But I am only getting host alerts. I have gotten 1 service alert for this host and their are multiple services setup. And that was for a flapping state change and not a service UP/DOWN state change like I would expect. Here is my service alert config for the particular server in question.

From Service Status Detail > Configure > Re-configure this service > Notifications
Selection_190.png
From CCM:
Selection_191.png
Selection_192.png
And I can see the service alerts in the logs but I never see a service notification. What else should I check?

Re: Should I see nagios XI alerts come through /var/log/mail

Posted: Tue Nov 01, 2016 3:18 pm
by linuser
OK, I think I see what's going on here. In my testing I was bringing the host all the way down from nagios perspective so I suppose the logic there is if the host is completely down so are the services. Once I brought the host back up and just blocked a port for a service I started to get service notifications. This thread can be closed.

Re: Should I see nagios XI alerts come through /var/log/mail

Posted: Tue Nov 01, 2016 4:18 pm
by rkennedy
Glad to see you got it working, closing this one out.

Feel free to make a new thread if you have questions in the future.