Page 1 of 1

Unexpected inheritance of host template contacts

Posted: Mon Oct 21, 2013 3:38 am
by WillemDH
Is it normal for a service to inherit it's host template contacts?

When i check http://nagios.sourceforge.net/docs/3_0/ ... tance.html, it is said in the implied inheritance section that only contactgroups of the host are inherited by a service. But I have a service that is sending email to a contact that is only configured in it's host template, which I didn't expect..

So I have a host with a host template and a service (with no template atm), there are no contacts/contact groups defined in the service and no contacts/contact groups on the host. The host template has 2 contacts defined and the service seems to send email when it's critical to the these two contacts.

Re: Unexpected inheritance of host template contacts

Posted: Mon Oct 21, 2013 11:29 am
by abrist
Services will in fact inherit the contacts from the host object. The difference that they are *not* implicitly inherited, as contacts on a host will *always* be contacts for that host's services.

Re: Unexpected inheritance of host template contacts

Posted: Mon Oct 21, 2013 12:30 pm
by WillemDH
Thanks again for your fast answer. I had some difficulties with the word implicit, but I think I get it now.
So contact groups need to be defined in the service or the service template or it will inherit the host or host template contact group.
You say host contacts will always be contact for that host services.
Does this mean always when it has standard and no service contact defined?
Because the way I see it now the host contacts are not inherited when the service has a contact defined. If I would set the contact options to +, would it mean the service contact and host contact are merged?
I just tested this and it seems the + in service contact option does not make the contacts from the host and the service template merge. So it seems if the service or service template has a contact defined the host contact is not inherited?

Re: Unexpected inheritance of host template contacts

Posted: Tue Oct 22, 2013 12:29 pm
by slansing
Can you show us the template, host, and service in question that you have been testing with? You can access their raw configuration output through CCM > {Host/Service Templates], [Hosts], [Services] > Click the blue diskette icon next to them.

Edit: Blocking out sensitive information of course!

Re: Unexpected inheritance of host template contacts

Posted: Tue Oct 22, 2013 2:21 pm
by WillemDH
Hmmm, it's kind of full with 'sensible' information... I've been testing this and it seems when a service contact has '+' configured, the service template contacts are added to the contact list, but the host contacts are not.

Code: Select all

Service S_1 with service template ST_1 with Contact Options +    => Contact A
Service template ST_1             => contact B
Host H_1 with host template _HT_1              => No contacts
Host template HT_1 => Contact C
With this config the service only contacted A and B
The above seems strange as I would expect the + to not only merge the ST_1's contacts, but also HT_1's contacts which was not so in my test.

Code: Select all

Service S_1 with service template ST_1 with Contact Options Standard    => No contact
Service template ST_1             => contact B
Host H_1 with host template _HT_1              => No contacts
Host template HT_1 => Contact C
With this config the service only contacted C, which seems normal.

I did not test anything with contact groups, but I still not completely understand the difference for inheritance to be honest.

Re: Unexpected inheritance of host template contacts

Posted: Tue Oct 22, 2013 4:17 pm
by abrist
Looks like I need to amend my previous statement with an exception:
Contacts on a host will *always* be contacts for that host's services except when a contact is defined on the service object itself.

Re: Unexpected inheritance of host template contacts

Posted: Wed Oct 23, 2013 9:45 am
by WillemDH
Ok, that's making a lot more sense to me.. As I'm planning to configure a contact for each service this shouldn't be an issue. You can close the thread.