Page 1 of 2

Understanding notifications and object inheritance

Posted: Tue Jan 21, 2020 5:06 pm
by pspagnola
I am new to nagios, so excuse my ignorance.

I have read this:
https://assets.nagios.com/downloads/nag ... tance.html

My understanding:
- I can use templates to manage the settings for hosts/services allowing me to make small changes that apply to many objects.
- If multiple templates apply to an object and the templates don't have conflicting settings, then the object gets the sum of settings from all templates.
- If multiple templates apply to an object and the templates DO have conflicting settings, then the object resolves the conflict by using the first template (top one listed on the associated templates screen?) that defines the value; except when the value is defined directly on the object which always wins over any template.
- to convert an object from explicit (direct) settings to implicit (template), I have to remove all the settings from the object. perhaps using the bulk modification tool.

Correct me if I am wrong.

My questions:
- If an object or template has the notification option set to "skip" does it get all alert settings from the "upstream" template, or just the notification option ("on/off/skip/null")? Like the interval and the contacts / contact groups that are associated with the alert settings?
- If I have 10 hosts, 7 hosts need to send alerts to Team A, 3 hosts need to sent alerts to Team B, and all 10 hosts need to send alerts to Team C; then I could create a template for each of the three teams and applying the templates as needed to hosts.

Thanks in advance.

Re: Understanding notifications and object inheritance

Posted: Tue Jan 21, 2020 5:30 pm
by Box293
Your understanding is correct.

This documentation is going to help a lot at times.
https://assets.nagios.com/downloads/nag ... tions.html
pspagnola wrote:- If an object or template has the notification option set to "skip" does it get all alert settings from the "upstream" template, or just the notification option ("on/off/skip/null")? Like the interval and the contacts / contact groups that are associated with the alert settings?
Looking at a service, "notifications enabled" has a skip, "notification options" does not have a skip.

It's all about layering. When Nagios Core starts it creates a final object which is everything layered together. Skip means don't take this option when creating the config. If interval is not defined it will use whatever has been defined previously. Contacts / Contactgroups have separate options for combining settings.
pspagnola wrote:- If I have 10 hosts, 7 hosts need to send alerts to Team A, 3 hosts need to sent alerts to Team B, and all 10 hosts need to send alerts to Team C; then I could create a template for each of the three teams and applying the templates as needed to hosts.
Yes that is one way. Another way is done through escalations. https://assets.nagios.com/downloads/nag ... ations.pdf

This is a complicated topic so please feel free to ask very specific questions.

Re: Understanding notifications and object inheritance

Posted: Tue Jan 21, 2020 5:41 pm
by pspagnola
Thanks for the escalation document. I will use that in the future. I want to make sure I understand basic notification logic before I do that.
Contacts / Contactgroups have separate options for combining settings.
Are you referring to escalations here or some other combination logic that is different from other object inheritance?

Re: Understanding notifications and object inheritance

Posted: Tue Jan 21, 2020 5:43 pm
by pspagnola
I should have also asked in my last reply:

If host notifies Group A per direct settings and template of host notifies Group B, then does group A and B get the alert or only group A?

Re: Understanding notifications and object inheritance

Posted: Tue Jan 21, 2020 5:59 pm
by Box293
pspagnola wrote:Thanks for the escalation document. I will use that in the future. I want to make sure I understand basic notification logic before I do that.
Contacts / Contactgroups have separate options for combining settings.
Are you referring to escalations here or some other combination logic that is different from other object inheritance?
Contacts / Contactgroups have layering that is standard in all configs, escalations are an additional thing which allow more flexibility.
pspagnola wrote:I should have also asked in my last reply:

If host notifies Group A per direct settings and template of host notifies Group B, then does group A and B get the alert or only group A?
That depends on your choices such as +, Null or Standard. + is the only one that layers.

There is no if this/then/that logic with standard notifcations and templates, it's notify all the contacts regardless. The contacts themselves may be configured to not accept notifications of certain types etc. Escalations is the only way to notify different groups separately.

Re: Understanding notifications and object inheritance

Posted: Wed Jan 22, 2020 9:19 am
by pspagnola
Where do I select from + / Null / Standard in the Nagios XI GUI?

Re: Understanding notifications and object inheritance

Posted: Wed Jan 22, 2020 5:50 pm
by Box293
In the window where you select the contact or contact group, they appear down the bottom.

Re: Understanding notifications and object inheritance

Posted: Thu Jan 23, 2020 10:44 am
by pspagnola
thank you. I never noticed those options before.

Can you explain what each one does or provide a link for me to read?

Re: Understanding notifications and object inheritance

Posted: Thu Jan 23, 2020 10:56 am
by scottwilkerson
+ is additive inheritance
null removes inheritance

https://assets.nagios.com/downloads/nag ... tance.html

Re: Understanding notifications and object inheritance

Posted: Thu Jan 23, 2020 11:49 am
by pspagnola
so....


+ means add these contacts and contact groups to the ones that may already be inherited from upstream templates.
null means use these contacts and contact groups, ignore upstream templates.
standard means ???

I am guessing standard means use either + or null based on what the default is as defined somewhere else?