Page 2 of 2

Re: check_nt (server port must be an integer) error

Posted: Mon Feb 22, 2016 7:08 am
by tejanagios
HI Lmitchev,

Thankyou for your help, I've figured out and understood object inheritance now , which is a game changer.

I have the following things that need clarity,

1.We define custom variables in either service or host definitions and modify the actual command definition in commands.cfg to accept this custom variable correct.?

2. Instead of creating custom variables on host direclty, i'd define a template with custom variable, use the template to define hosts or services thereafter. ( tried it but the object created did not inherit the custom variable value from the template)

3. Notification and alert settings are present when defining both a host and service, when I use a host template and service template to define both, which template takes precedence ?

Re: check_nt (server port must be an integer) error

Posted: Mon Feb 22, 2016 12:44 pm
by lmiltchev
1.We define custom variables in either service or host definitions and modify the actual command definition in commands.cfg to accept this custom variable correct.?
This is correct. Here's some examples of what custom macros you could use:
https://assets.nagios.com/downloads/nag ... tvars.html
2. Instead of creating custom variables on host direclty, i'd define a template with custom variable, use the template to define hosts or services thereafter. ( tried it but the object created did not inherit the custom variable value from the template)
It is hard to say why the custom variables didn't get inherited without looking at your configs. Can you show us all of the relevant config files? We will try to recreate the issue in house.
3. Notification and alert settings are present when defining both a host and service, when I use a host template and service template to define both, which template takes precedence ?
Again, can you show us an example?
Host templates are applied to hosts, and service templates are applied to services. In regards to notifications, different notification handlers are used for hosts and services, i.e "xi_host_notification_handler", and "xi_service_notification_handler".
In case, where you have two or more templates added to a host/service, the one "on the top" will be used first, then that one below, etc. Example:
example01.PNG