Nagios 2.x bug in pre-flight check with incomplete templates

Thomas Guyot-Sionnest thomas at zango.com
Tue Nov 13 20:37:20 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tested against 2.7 and latest CVS: When I define a template like this:

define servicedependency {
  dependent_hostgroup_name hsgrp_1,hsgrp_2,hsgrp_x
  name                     template_name
  register                 0
}

Nagios bails out with the following error:

Error: Could not expand master hostgroups and/or hosts specified in
service dependency (config file '/path/to/config', starting on line 88)

Looking quickly at the code it seems that it could affect many other
objects... I didn't have time to pinpoint the problem though. I can
possibly take a deeper look tonight if it's not obvious to anyone more
used to play with the template code.

As a workaround I can define a host_name and override it in the service
definition.

You may ask why I have a so simple template definition? The answer is
that I keep all hostgroup lists at the same place and grouped together,
so that when I add/remove hostgroups I don't need to grep around the
config to make sure I didn't miss something. (While we're at it, I'm
just thinking that the ability to get a hosts list out of a service
templates would be nice if it can be done in a sane way...)

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHOfzw6dZ+Kt5BchYRAt10AKC0AjImevWweeXAcVJxBGe3H51X7ACg3u8I
elzX6DmaT5Umyd9veWYWQOA=
=K7AC
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/




More information about the Developers mailing list