Possible discrepancy in Documentation and Functionality of Nagios v2.0b6

Andreas Ericsson ae at op5.se
Wed Dec 28 18:54:31 CET 2005


Zac wrote:
> Hello,
>    I have been running nagios 1.x for a long time now and am very excited to
> start using v2.  I have setup a development system and am re-organizing my
> config with some of the new features.  I have run into an issue that,
> according to the way I am interpreting the documentation should work.
> 
> What I am trying to do, is remove the hostgroup definitions in favor of
> putting the hostgroup line in the host definition template.  I am hoping to
> remove the long lists of hosts on the members line.  In the documentation it
> states that it can be "used as an alternative to (or in addition to) the *
> hostgroups* directive in host
> definitions<http://nagios5/docs/xodtemplate.html#host>."
> but this doesn't seem to be the case.  If I do not make a hostgroup
> definition, and only use the hostgroup line in the host definition, I get
> the error that the hostgroup doesn't exist.  If I create the hostgroup and
> put 1 host in the members line, everything works, but it breaks my
> templates, or puts a duplicate host or service in the group and makes my
> config files more confusing.  If I create a hostgroup with no members line,
> it errors out as well.
> 

The hostgroup still needs to be created. There doesn't have to be a 
"members" line, but there has to be hosts in the hostgroup. You can thus 
create a config such as this

define hostgroup{
	hostgroup_name  hostgrp
	alias           Alias for hostgrp
}

define host {
	use        the_template_that_includes_everything
	host_name  the_host
	hostgroups hostgrp
}


> My question is, is it planned that I can use the hostgroup directive in the
> host definition as a complete alternative to the hostgroup definition?


No. It's planned to replace/extend the "members" directive in the 
hostgroup object definition. Hostgroups aren't created on the spot.


>  I
> understand we need to define the alias for the host group, and I would be
> fine with creating the hostgroup definition and only populating the name and
> alias, but I really want to avoid duplication or messy members lines.


Then this is what you should do. I know for a fact that it works, so if 
you can't make it so, send me your configuration and I'll test it myself.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click




More information about the Developers mailing list