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
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Email notifications only going to nagiosadmin contact

Post by mcapra »

The templates seem to be leveraging the admins contact group, but it's not immediately clear who is in that contact group or what hosts/services are using these templates.

Can you also send over your contactgroups definitions as well as a sample host+service file you would expect someone other than nagiosadmin to receive notifications for?
Former Nagios employee
https://www.mcapra.com/
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

I sent the contacts file via PM to dwhitfield. I'll PM a host file to you. Thanks.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Email notifications only going to nagiosadmin contact

Post by dwhitfield »

There is a contact group in contacts.cfg, but perhaps you also have a /usr/local/nagios/etc/contactgroups.cfg? I think that's what @mcapra seeks.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

Oh. No, that file doesn't exist. Just contacts.cfg.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Email notifications only going to nagiosadmin contact

Post by dwhitfield »

There are a few ways to solve this, but probably the easiest is to add automation (and whoever else) to the admins contract group in contacts.cfg.

You could also add the contact directly to the templates, but that means changing all the templates.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Email notifications only going to nagiosadmin contact

Post by mcapra »

Also, the host you sent me only appears to have "automation" defined under the contacts:

Code: Select all

define host {
	use		generic-switch		; Inherit default values from a template
	host_name	ProCurve202 		; The name we're giving to this switch
	alias		HP ProCurve 3500-24-PoE in 5th Floor Mens Room
	address		156.121.62.202	; IP address of the switch
	parents		ProCurveFibre  		
        contacts        automation
	}
It also inherits this from the generic-switch template:

Code: Select all

contacts		automation
And nothing from the switches hostgroup, unless that exists somewhere other than contacts.cfg. So, I can't see anywhere where this particular host should be receiving notifications for nagiosadmin; Just automation.
Former Nagios employee
https://www.mcapra.com/
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

And that's the weird thing. Mail only goes to the nagiosadmin contact, even with these settings.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

dwhitfield wrote:There are a few ways to solve this, but probably the easiest is to add automation (and whoever else) to the admins contract group in contacts.cfg.

You could also add the contact directly to the templates, but that means changing all the templates.
Well I already had that automation contact in one of the templates but still any notifications only go to nagiosadmin.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Email notifications only going to nagiosadmin contact

Post by mcapra »

Can you do a service nagios restart and send over the contents of your objects.cache file? It's typically (but not always) found here:

Code: Select all

/usr/local/nagios/var/objects.cache
Former Nagios employee
https://www.mcapra.com/
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

I've already PM'd that to dwhitfield. Do you still want it again?
Locked