Page 1 of 1

Service templates and inheritance

Posted: Fri Oct 09, 2015 9:14 am
by drug
I'm trying to determine the best/easiest way to add several similar hosts using the least amount of work. I thought the way to do this would be to create service templates and then assign those templates to a hostgroup. This sort of works.

I have a Service Template called "DISK - /". Assigning this to a hostgroup appears to work (that is, the Service is being checked on the hosts within that hostgroup). However, I want to be able to change the value of the Checkcommand Arguments on only some of these hosts. I thought the way to do this would be to create a Service with the Config Name of the host on which I wanted to change these arguments and add the "DISK - /" Service Template to this Service. When I do this, no matter what I modify, even the Description, it does not take affect within Nagios core.

What am I doing wrong here? Thanks.

Nagios XI 2014R2.7

Re: Service templates and inheritance

Posted: Fri Oct 09, 2015 11:42 am
by jdalrymple
You're on the right track.
drug wrote:However, I want to be able to change the value of the Checkcommand Arguments on only some of these hosts.
2 options:
1) Create separate hostgroups for different arguments and have 2 services, or at least a check_command override that smacks your earlier defined template in different hostgroups.
or, more elegant, perhaps a bit more difficult to put together and understand:
2)Custom Object Variables
Note that custom object variables can be defined in host templates.

Re: Service templates and inheritance

Posted: Fri Oct 09, 2015 11:49 am
by drug
Thanks, it looks like the second option will do what we need.

Re: Service templates and inheritance

Posted: Fri Oct 09, 2015 12:10 pm
by hsmith
Is there anything else we can help you with regarding this particular issue?

Re: Service templates and inheritance

Posted: Fri Oct 09, 2015 12:28 pm
by drug
That's all for now thanks.