Email notifications only going to nagiosadmin contact

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Email notifications only going to nagiosadmin contact

Post by tgriep »

I took a look at some of the host and service checks in the object.cache file and I think I know what it going on.
I did not go through all of the services but it look like every service only has the admins contact group assigned to it and the only contact in the admin contact group is the nagiosadmin contact.
That is the reason none of the service checks are sending an email to other users when a service check fails. If you want to receive a notification to another contact for a service, you will have to add a contact to the service or add a contact to the admins contact group/

The host checks do look like they should work for the different contacts / contact groups assigned to them, but for a test, can you simulate a host down for the ProCurve203 host.
Does the automation contact receive an email?

Does that help at all?

If you have a specific user you want to receive notifications for a specific host or service, let up know the details and we can better help out in setting that up.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

Thanks, but I'm not totally understanding here. I definitely do not want the contact in the admin group. In fact, I don't need that group at all, but Nagios seems to insist that I have it. I can't restart without it. So I have the contact I want, which I just created and called "test-admin", and have that contact in the linux-servers template as well as the server itself (one of the linux servers is much easier for me to simulate a down situation). Still notifications only go to the nagiosadmin contact.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Email notifications only going to nagiosadmin contact

Post by tgriep »

Edit the generic-contact template and add the following options to it to enable the host and service notifications

Code: Select all

host_notifications_enabled    		1
service_notifications_enabled 		1
Save the settings and restart the nagios processes by running the following

Code: Select all

service nagios restart
Try that and see if email notifications work for that host.

If not, you will have to PM in your configuration files for the templates, hosts, services and contacts so we can view the settings.
If you have a specific user you want to receive notifications for a specific host or service, let us know the details and we can better help out in setting that up.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

I added those two settings for the generic contact, but still the notification emails only go to nagiosadmin. I'll PM you the files you asked for.

By the way, I mentioned it after installing Nagios, but the command for starting/restarting/stopping under RHEL 7 is:

Code: Select all

systemctl restart nagios
Thanks again.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

Files PM'd. Thanks.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Email notifications only going to nagiosadmin contact

Post by tgriep »

I took a look at your settings, it you shut off the host, do you receive a email notification for the host check being critical to the other email address?

All of the service checks for that host, have the template called generic-service applied to them.
That template, has the contact group admins applied to it so that is why all of the emails go to the nagiosadmin contact through that group.

Edit the generic-service template and remove the contact_group from that service. That will stop all of the emails for all of the services that use that template from being sent to the nagiosadmin contact.

Then, go and edit that host and for every service, add this entry

Code: Select all

contacts		test-admin
Save the settings and restart nagios.
Then, generate an error to force a notification and go to the Reports Notifications menu, if you see the notification generated for that user but did not receive an email, then check the maillog file for any errors on why the email did not get sent.

Code: Select all

/var/log/maillog
Be sure to check out our Knowledgebase for helpful articles and solutions!
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

That was it! I didn't put two and two together and consider the generic-service template. I commented out the group from all of the templates and now it's going to whatever contact I specify in the host's config. Thank you!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Email notifications only going to nagiosadmin contact

Post by cdienger »

Glad you were able to get it to do what you wanted it to do! Are we okay locking the thread at this point?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

Absolutely. Thanks so much again for all the help.
Locked