Disable Inheritance at Service/Contact Level

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
MikeMAN987
Posts: 58
Joined: Fri Sep 29, 2017 9:57 am

Disable Inheritance at Service/Contact Level

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Disable Inheritance at Service/Contact Level

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
MikeMAN987
Posts: 58
Joined: Fri Sep 29, 2017 9:57 am

Re: Disable Inheritance at Service/Contact Level

Post by MikeMAN987 »

Thank you for the suggestion. Updating the applied template will not change any contacts already assigned to specific checks correct?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Disable Inheritance at Service/Contact Level

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked