Page 2 of 3

Re: Email notifications only going to nagiosadmin contact

Posted: Wed Apr 05, 2017 12:41 pm
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?

Re: Email notifications only going to nagiosadmin contact

Posted: Wed Apr 05, 2017 12:50 pm
by hazmat
I sent the contacts file via PM to dwhitfield. I'll PM a host file to you. Thanks.

Re: Email notifications only going to nagiosadmin contact

Posted: Wed Apr 05, 2017 1:34 pm
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.

Re: Email notifications only going to nagiosadmin contact

Posted: Wed Apr 05, 2017 1:55 pm
by hazmat
Oh. No, that file doesn't exist. Just contacts.cfg.

Re: Email notifications only going to nagiosadmin contact

Posted: Wed Apr 05, 2017 4:31 pm
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.

Re: Email notifications only going to nagiosadmin contact

Posted: Wed Apr 05, 2017 4:43 pm
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.

Re: Email notifications only going to nagiosadmin contact

Posted: Thu Apr 06, 2017 8:23 am
by hazmat
And that's the weird thing. Mail only goes to the nagiosadmin contact, even with these settings.

Re: Email notifications only going to nagiosadmin contact

Posted: Thu Apr 06, 2017 3:42 pm
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.

Re: Email notifications only going to nagiosadmin contact

Posted: Thu Apr 06, 2017 4:27 pm
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

Re: Email notifications only going to nagiosadmin contact

Posted: Fri Apr 07, 2017 8:31 am
by hazmat
I've already PM'd that to dwhitfield. Do you still want it again?