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

Ethan Galstad nagios at nagios.org
Fri Nov 16 18:53:05 CET 2007


Thomas Guyot-Sionnest wrote:
> -----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...)

Thanks for the note.  I'll get a patch into the 2.x branch in a moment. 
  The code in the 3.x/head branch appears to handle this properly.

Ethan Galstad
Nagios Developer
___
Email: nagios at nagios.org
Web:   www.nagios.org

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list