typo in xodtemplate.c

Caylan Van Larson i at caylan.net
Thu Jun 26 16:17:09 CEST 2008


Hi,

I'm seeing this typo when I try to dynamically define services on  
hosts using hostgroups.  That is, a set of services are "mapped" to an  
empty hostgroup, and then hosts are defined as members inside of the  
"define host" directive.  This works very well for defining a set of  
default services as documented at, "All Hosts In Multiple Hostgroups"  
- http://nagios.sourceforge.net/docs/3_0/objecttricks.html.

Using this technique - when I run a pre-flight check on my configs it  
warns me of duplicates.  I think this is a bug since the "defining  
moment" of one of these services happens twice in the eyes of the  
sanity checker "skiplist_insert":  1) when you map the service to a  
hostgroup (meta host object?) and then again, 2) when you subscribe  
the host to the hostgroup and the service is actually created.

I don't see how these are reported as duplicates when the code right  
before the logit() message is:

                 /* skip service definitions without enough data */
                 if(temp_service->host_name==NULL || temp_service- 
 >service_description==NULL)
                         continue;

Please see this thread:  http://www.meulie.net/portal_plugins/forum/forum_viewtopic.php?11467.last

Any ideas?

---

Caylan


> hello
>
> There is a smale typo in xodtemplate.c around line 5215 (nagios  
> 3.0.2):
>
> logit(NSLOG_CONFIG_WARNING,TRUE,"Warning: Duplicate definition found  
> for service '%s' on host '%s'
> (config file '%s', starting on line %d)\n",temp_service- 
> >host_name,temp_service- 
> >service_description,xodtemplate_config_file_name(temp_service- 
> >_config_file),temp_service->_start_line);
>
> host_name and service_description have been swaped.
>
> -- 
> Stéphane Urbanovski

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php




More information about the Developers mailing list