Contact Template Not Working?

Mueller, Karl KMueller at netsuite.com
Mon Apr 19 23:03:59 CEST 2004


> 
> Cue people telling me that over-riding is not only possible, it's
> well-documented.  I wish they would, because I hate having to cut and
> paste a check command many times in services.cfg just so that I can
> have a different command or different set of arguments for one host
> out of many. 

Paul,

It's your lucky day.  We use templates extensively and override many
configuration options.  

The trick, as with all templated objects, is to have the "name" entry,
which is the template name you inherit from.  I just checked the nagios
source code, and it appears to handle templated check_commands.  

In other words, you have your "standard" service:

Define service {
	name blah_service_template
	service_description foofoo
	check_command XXXX
	...
}

(this is an actual service object, so register 0 is not used)

define service {
	service_description foofoo
	check_command YYYYY
	use blah_service_template
	...
}

Of course, you can't define the service for a hostgroup or servicegroup,
and then override the service for some particular members of those
groups.  You have to structure the hostgroups/servicegroups and service
definitions better, i.e. create a separate group(s) for the differences.
If you do not have "register 0", the important thing to keep in mind is
you are CREATING a service instances, even if you mean to use it later
as a template.

Alternately, you can have a single master pure "template" that the
others inherit from, missing the check_command entry.  This way, you are
very clear about the differences.  (This is how we approach most
common-source templates to avoid confusion)

Karl







-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list