Is it possible to have a service inherit a service template, and have some parameters set on the service and some on the template?
I'm using CCM for configuration at the moment, and it seems to not store any parameters entered unless there is a check command, and therefore all parameters must be specified on every service, and not on a template.
Inheritance and check_commands in service templates
Inheritance and check_commands in service templates
Cyl
Nagios Core 4.3.4 on Ubuntu 16.04.3
Nagios Core 4.3.4 on Ubuntu 16.04.3
Re: Inheritance and check_commands in service templates
If something is set on a template and on the service that uses it, the setting in the service will override what is configured in the template. If a required config setting is not specified in either of them, you will not be able to apply the service.
Former Nagios employee
Re: Inheritance and check_commands in service templates
That doesn't really answer my question though - in CCM I have a service template with the check_command defined, and would like to specify values for $ARG1$ on the 'actual' service.
Looking at the way the arguments are defined, I guess this isn't possible, as they are not separate parameters on the service, but just a part of the check_command.
I might be able to work around this using variable definitions or something like that.
Looking at the way the arguments are defined, I guess this isn't possible, as they are not separate parameters on the service, but just a part of the check_command.
I might be able to work around this using variable definitions or something like that.
Cyl
Nagios Core 4.3.4 on Ubuntu 16.04.3
Nagios Core 4.3.4 on Ubuntu 16.04.3
Re: Inheritance and check_commands in service templates
You can override the check_command in the service definition and use a different command that allows you to pass the args.
Of course, you have to make a new command definition as well, but if you're mucking about in CCM, copying a command to a new one that allows args isn't too bad.
Of course, you have to make a new command definition as well, but if you're mucking about in CCM, copying a command to a new one that allows args isn't too bad.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Inheritance and check_commands in service templates
It sounds like you want a simple configuration pushed out to multiple hosts but each host to provide a specific value.
One way of doing this is:
Some reading on custom object variables:
http://nagios.sourceforge.net/docs/3_0/ ... tvars.html
I hope this helps without causing too much confusion.
One way of doing this is:
- Each host object has a custom object variable created (we'll call it _MYSETTING)
Create a host group called MYSETTING_HOSTGROUP
Create a service that uses MYSETTING_HOSTGROUP
The service has the command selected
The service needs $ARG1$ to specify the _MYSETTING value, so $ARG1$ is set to $_HOSTMYSETTING$
Some reading on custom object variables:
http://nagios.sourceforge.net/docs/3_0/ ... tvars.html
I hope this helps without causing too much confusion.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Inheritance and check_commands in service templates
I'm not trying to "compete" with Troy, but I want to point out that my suggestion (use a different check_command that allows for ARG passing) and his suggestion (using custom host/service/contact macros) will solve slightly different problems.
So maybe it would help if you provided an example of what you're trying to accomplish? Or are you all set at this point?
So maybe it would help if you provided an example of what you're trying to accomplish? Or are you all set at this point?
Re: Inheritance and check_commands in service templates
Yeah, thanks. The $ARGx$ pretty much solves it.
Cyl
Nagios Core 4.3.4 on Ubuntu 16.04.3
Nagios Core 4.3.4 on Ubuntu 16.04.3
Re: Inheritance and check_commands in service templates
Closing this thread now, but feel free to open another if you need anything in the future.
Former Nagios employee