Page 1 of 1

HOST VS TEMPLATE settings when configuring checks

Posted: Tue Jun 07, 2016 2:22 pm
by dlukinski
Hello XI support

Which settings would take precedence when configuring templates as follows:

Host template (contains contact group, monitoring and notification frequencies) / group of hosts has one configured instead of default template 1:1 (every host has applicable template set by-host)

Service template (same monitoring and notification frequencies, sometimes different from those specified in host) 1:1 to various service checks

Now we have hosts added to service checks (where host subjected to one template and service check to another template

- How to make this right?

Re: HOST VS TEMPLATE settings when configuring checks

Posted: Tue Jun 07, 2016 3:37 pm
by lmiltchev
Using multiple layers of templates could get tricky. In general, the host templates are applied to hosts, the service templates - to services. If you had the same directive added to multiple templates (that are added to a host/service), nagios would use the value defined in the first template. You may have "Cancelling, Additive or Implied Inheritance"... Also, local variables would always override the ones in templates. So, without looking at a specific example, it is hard to say what template would take precedence.

For more information, please review our documentation on Object Inheritance here:
https://assets.nagios.com/downloads/nag ... tance.html

Tip: When in doubt, you can always review the host/service configs in the objects.cache to see what directives are being used.

Hope this helps.

Re: HOST VS TEMPLATE settings when configuring checks

Posted: Tue Jun 07, 2016 3:46 pm
by dlukinski
lmiltchev wrote:Using multiple layers of templates could get tricky. In general, the host templates are applied to hosts, the service templates - to services. If you had the same directive added to multiple templates (that are added to a host/service), nagios would use the value defined in the first template. You may have "Cancelling, Additive or Implied Inheritance"... Also, local variables would always override the ones in templates. So, without looking at a specific example, it is hard to say what template would take precedence.

For more information, please review our documentation on Object Inheritance here:
https://assets.nagios.com/downloads/nag ... tance.html

Tip: When in doubt, you can always review the host/service configs in the objects.cache to see what directives are being used.

Hope this helps.
How to get to object.cache ?

I check HOSTS via ICMP or HTTP (more frequent, to avoid over-notification in the event of failure) - something you suggested few month ago when I asked
Now, services are countless and done against many hosts, so attempted using templates by service type to be able to change configurations quickly and segregate DEV / PROD service check frequencies and notifications

How can I do that?

Re: HOST VS TEMPLATE settings when configuring checks

Posted: Tue Jun 07, 2016 4:00 pm
by hsmith
dlukinski wrote:How to get to object.cache ?

Code: Select all

vi /usr/local/nagios/var/objects.cache
dlukinski wrote:I check HOSTS via ICMP or HTTP (more frequent, to avoid over-notification in the event of failure) - something you suggested few month ago when I asked
Now, services are countless and done against many hosts, so attempted using templates by service type to be able to change configurations quickly and segregate DEV / PROD service check frequencies and notifications
I don't fully understand this question. Are you asking how to change something quickly? I'd have multiple templates for multiple purposes and change the template as need be.

Re: HOST VS TEMPLATE settings when configuring checks

Posted: Wed Jun 08, 2016 5:41 am
by dlukinski
hsmith wrote:
dlukinski wrote:How to get to object.cache ?

Code: Select all

vi /usr/local/nagios/var/objects.cache
dlukinski wrote:I check HOSTS via ICMP or HTTP (more frequent, to avoid over-notification in the event of failure) - something you suggested few month ago when I asked
Now, services are countless and done against many hosts, so attempted using templates by service type to be able to change configurations quickly and segregate DEV / PROD service check frequencies and notifications
I don't fully understand this question. Are you asking how to change something quickly? I'd have multiple templates for multiple purposes and change the template as need be.
--------------------------------------------
NO I asked which template host or service would take precedence imposing monitoring and notification frequency (both of them having different numbers)
- IF we cannot answer this question, should we "hardcode" host monitoring and notification frequency and keep services under templates?

Re: HOST VS TEMPLATE settings when configuring checks

Posted: Wed Jun 08, 2016 12:27 pm
by ssax
If it's a service, the service template would take priority. If it's a host, the host template would take priority.

The service would only inherit the hosts settings (certain ones) if it didn't have those defined. See the implied inheritance section here:

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

Re: HOST VS TEMPLATE settings when configuring checks

Posted: Sat Jun 11, 2016 7:53 am
by dlukinski
ssax wrote:If it's a service, the service template would take priority. If it's a host, the host template would take priority.

The service would only inherit the hosts settings (certain ones) if it didn't have those defined. See the implied inheritance section here:

https://assets.nagios.com/downloads/nag ... tance.html
Thank you, This answers my question.

Re: HOST VS TEMPLATE settings when configuring checks

Posted: Mon Jun 13, 2016 10:01 am
by mcapra
Is it alright if we lock this thread and mark the issue as resolved?

Re: HOST VS TEMPLATE settings when configuring checks

Posted: Tue Jun 14, 2016 6:36 am
by dlukinski
mcapra wrote:Is it alright if we lock this thread and mark the issue as resolved?
Yes please and thank you