Overriding/removing hostgroup_name from service template?

Sean Dilda agrajag at dragaera.net
Wed Nov 10 15:39:06 CET 2004


On Tue, 2004-11-09 at 23:33, Steven Danz wrote:
> Hello
> 
> I'm trying out the uses of templates in 1.2 and noticed that if I define 
> a service template that uses a hostgroup_name, later when I use the 
> template there doesn't seem to be a way to drop the hostgroup_name if I 
> have a service that I only want to monitor on one host.  Adding 
> host_name gets both the single host along with the hostgroup monitored 
> for the service. If hostgroup_name is given with a blank entry, nagios 
> complains about parsing the line.  Is there a way to list hostgroup_name 
> with an 'empty' entry so as to remove it, leaving the host_name as the 
> only thing defined?  It goes something like:
> 
> define service{
>         name                            8x5-service
>         use                             generic-service
>         register                        0
>         is_volatile                     0
>         check_period                    24x7
>         max_check_attempts              3
>         normal_check_interval           5
>         retry_check_interval            1
>         notification_interval           120
>         notification_period             workhours
>         notification_options            c,r
>         contact_groups                  linux-admins
>         }
> 
> # For the most part, we monitor the same things on all the evaluation 
> systems
> define service{
>         name                            8x5-eval-service
>         register                        0
>         use                             8x5-service
>         hostgroup_name                  evaluation_servers
>         contact_groups                  evaluation-admins
> }
> .
> .
> .
> # For this one system, we have a special service so we only want to monitor
> # it on the one server.  The settings in 8x5-eval-service are still 
> good, except
> # that there doesn't seem to be a way to drop the hostgroup_name without 
> specifying
> # a new one.  Writing it like this attempts to monitor the service on both
> # the host_name host and all the hosts in the hostgroup_name from the 
> template.
> define service{
>         use                             8x5-eval-service
>         service_description             Service only on one system
>         host_name                       server1
>         check_command                   check_nrpe!check_special_service
> }
> 

How about changing that to:
define service{
	use				8x5-service
	contact_groups			evalutation-admins
	service_description		Service only on one system
	host_name			server1
	check_command			check_nrpe!check_special_service
}

It's only one extra line, which you'd be using to blank out
hostgroup_name anyways.

Although I am a little confused.  Why do you have a service with
'register 0' with a hostgroup_name defined?  I would think that you'd
only want to define host_name or hostgroup_name in the actual service
definition, not for any templates.



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&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