Bug in Custom Object Variables (Nagios 3.0RC1) (patch)

td at Dunkel.de td at Dunkel.de
Mon Jan 14 15:38:07 CET 2008


Hi,

I think I've found the bug.
With this patch it works fine.

Please check, if all is ok with this patch. :-)

Best regards,
Thomas Dohl

-start---------------------------------------------------------------------------------------------------
--- common.old/macros.c 2007-12-14 18:44:31.000000000 +0100
+++ common/macros.c     2008-01-14 15:13:17.000000000 +0100
@@ -3169,12 +3169,12 @@
                set_macro_environment_var(temp_customvariablesmember->variable_name,clean_macro_chars(temp_customvariablesmember->variable_value,STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS),set);
                }

-       /***** CUSTOM HOST VARIABLES *****/
+       /***** CUSTOM SERVICE VARIABLES *****/
        /* generate variables and save them for later */
        if((temp_service=macro_service_ptr) && set==TRUE){
                for(temp_customvariablesmember=temp_service->custom_variables;temp_customvariablesmember!=NULL;temp_customvariablesmember=temp_customvariablesmember->next){
                        asprintf(&customvarname,"_SERVICE%s",temp_customvariablesmember->variable_name);
-                       add_custom_variable_to_object(&macro_custom_host_vars,customvarname,temp_customvariablesmember->variable_value);
+                       add_custom_variable_to_object(&macro_custom_service_vars,customvarname,temp_customvariablesmember->variable_value);
                        my_free(customvarname);
                        }
                }
@@ -3187,7 +3187,7 @@
        if((temp_contact=macro_contact_ptr) && set==TRUE){
                for(temp_customvariablesmember=temp_contact->custom_variables;temp_customvariablesmember!=NULL;temp_customvariablesmember=temp_customvariablesmember->next){
                        asprintf(&customvarname,"_CONTACT%s",temp_customvariablesmember->variable_name);
-                       add_custom_variable_to_object(&macro_custom_host_vars,customvarname,temp_customvariablesmember->variable_value);
+                       add_custom_variable_to_object(&macro_custom_contact_vars,customvarname,temp_customvariablesmember->variable_value);
                        my_free(customvarname);
                        }
                }
-END---------------------------------------------------------------------------------------------------


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace




More information about the Developers mailing list