Service templates and inheritance

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Service templates and inheritance

Post 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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Service templates and inheritance

Post 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.
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Re: Service templates and inheritance

Post by drug »

Thanks, it looks like the second option will do what we need.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Service templates and inheritance

Post by hsmith »

Is there anything else we can help you with regarding this particular issue?
Former Nagios Employee.
me.
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Re: Service templates and inheritance

Post by drug »

That's all for now thanks.
Locked