[PATCH] Fix to allow incomplete service dependency templates

Ethan Galstad nagios at nagios.org
Tue Dec 12 00:05:02 CET 2006


Jason Hoos wrote:
> The attached patch fixes a problem with parsing service dependency 
> templates that specify "hostgroups" without "dependent_hostgroups" or 
> vice versa.  The following config snippet triggers the bug:
> 
> define host {
>        use generic-host  ; generic host template omitted for brevity
>        host_name b
> }
> 
> define hostgroup {
>        hostgroup_name test-hg
>        alias test-hg
>        members a,b
> }
> 
> define servicedependency {
>        register 0
>        name base-sd
>        hostgroups test-hg
> }
> 
> Since it's not a registered object, the servicedependency template 
> should be
> valid, but Nagios reports "Could not expand dependent hostgroups and/or 
> hosts
> specified in service dependency" instead.
> 
> This patch applies to both Nagios 2.5 and 2.6.
> 
> Jason Hoos
> 

Actually, I think this should result in an error message, even though 
the template dependency isn't going to be registered.  Better to catch a 
problem earlier, rather than later when the template is being used.

Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV




More information about the Developers mailing list