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
Service templates and inheritance
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Service templates and inheritance
You're on the right track.
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.
2 options:drug wrote:However, I want to be able to change the value of the Checkcommand Arguments on only some of these hosts.
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
Thanks, it looks like the second option will do what we need.
Re: Service templates and inheritance
Is there anything else we can help you with regarding this particular issue?
Former Nagios Employee.
me.
me.
Re: Service templates and inheritance
That's all for now thanks.