Page 1 of 1

[SOLVED] Problem:Different Inheritance for Hosts vs Services

Posted: Tue Nov 12, 2013 2:12 pm
by kjhosein
I have a weird problem with Nagios inheritance.

Here's my setup:
  • * Hosts are all in Hostgroups
    * Contacts are all in Contactgroups
    * Services are assigned to Hostgroups (not to Hosts)
    * Contactgroups are assigned to Hosts
    * Contacts and contactgroups are *not* assigned to services. I'm depending on implied inheritance per http://nagios.sourceforge.net/docs/3_0/ ... nheritance for the service to inherit its contactgroup(s) from the host.
Here is an example of one of my contactgroups. The ones in the square brackets [] are the groups, and the others are just contacts:

[alerts_for_production]
|--ernie_for_production_email
|--bert_for_production_email
|--[backup_alert_group]
. . . |--grover_for_backup_email (grover is a contact member of the backup_alert_group)


But here's what's happening (from observing objects.cache):

The hosts see the contactgroup as alerts_for_production, but the associated services see the contactgroup as backup_alert_group. I would have thought that both hosts and associated services would see both alerts_for_production and backup_alert_group as the contactgroups.

As a test, I decided to add in a single contact to the host (for example, ernie_for_production_email). That worked as expected - both host and service were assigned that contact.

Is this expected behavior or is my understanding incorrect?
I'd appreciate any insight or thoughts. Thanks!

Re: Problem: Different Inheritance for Hosts vs Services

Posted: Tue Nov 12, 2013 2:48 pm
by lmiltchev
The following table lists the object variables that will be implicitly inherited from related objects if you don't explicitly specify their value in your object definition or inherit them from a template.
Can you show the service definition? Have you assigned any contacts/contactgroups to this service? Are you using a template?

Re: Problem: Different Inheritance for Hosts vs Services

Posted: Wed Nov 13, 2013 9:03 am
by kjhosein
Good call @lmiltchev! I had thought that my service template didn't have any contact info in it, but I was mistaken. Once I removed the contact group from the service template, the config expanded out as I expected.

Thanks!