Page 1 of 1

Disable Inheritance at Service/Contact Level

Posted: Tue Nov 27, 2018 3:08 pm
by MikeMAN987
Hello,

We are currently cleaning up an older installation of Nagios Core items that were imported into Nagios XI. All of these items (almost 10,000 of them), use templates which sometimes have the data we want, except for a small subset of about 1000 services that need different contact information. Is there a solution where we can prevent those 1000 items from inheriting the contact info from the template and update/remove it on a per-service level? Otherwise it sounds like the solution is to build another set of templates and manually reassign these items.

Thanks for any insight!

Regards,
Mike

Re: Disable Inheritance at Service/Contact Level

Posted: Tue Nov 27, 2018 3:22 pm
by lmiltchev
You could create a new template with the contact info you need, and apply it to all of the 1000 objects in bulk via the Bulk Modifications Tool. The "new" template will overwrite the "old" one, so the desired contacts will be inherited.

CCM > Tools > Bulk Modifications Tool > Change Templates

Important: You may need to do this in steps (500 objects at a time or less) to make sure you are not going to get a timeout.

Re: Disable Inheritance at Service/Contact Level

Posted: Wed Nov 28, 2018 12:18 pm
by MikeMAN987
Thank you for the suggestion. Updating the applied template will not change any contacts already assigned to specific checks correct?

Re: Disable Inheritance at Service/Contact Level

Posted: Wed Nov 28, 2018 1:47 pm
by lmiltchev
Updating the applied template will not change any contacts already assigned to specific checks correct?
My understanding was that your contacts were NOT assigned to objects directly, but were rather indirectly (inherited from a template)... Any "direct" assignment on a host/service level will override the values in the template.

Example 1
Your host inherits "contact1" from a template. You assign "contact2" directly to the same host. Now, "contact2" would be the only contact on this host.

Example 2
You have "contact2" assigned directly to the host. You add a new template to this host with "contact1" in it. This will not change a thing as local variables always take precedence over variables in templates. The "contact2" will still be the only contact on the host.

If you wanted to use both values - the "local" assignment AND the one from the template, you could need to use an additive inheritance.

CCM > Hosts (or Services) > Edit > Alert Settings > Manage Contacts > click on the "+" sign on the bottom.

Read more about object inheritance here:
https://assets.nagios.com/downloads/nag ... tance.html

Tip: In the CCM (under Host/Service Management > Alert Settings > Manage Contacts), you will only see the contacts that the assigned directly. You won't be able to see contacts that are inherited from a template. If you are unsure about what contacts are used in a host/service definition, you could open the objects.cache in a test editor and take a look. The path to the file is: /usr/local/nagios/var/objects.cache. If you are using ramdisk, the path would be: /var/nagiosramdisk/objects.cache.

Hope this helps.