[Nagios-devel] Bug in Custom Object Variables (Nagios 3.0RC1)
Posted: Mon Jan 14, 2008 6:37 am
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_MAC=
RO_CHARS|ESCAPE_MACRO_CHARS),set);
}
- /***** CUSTOM HOST VARIABLES *****/
+ /***** CUSTOM SERVICE VARIABLES *****/
/* generate variables and save them for later */
if((temp_service=3Dmacro_service_ptr) && set=3D=3DTRUE){
=
for(temp_customvariablesmember=3Dtemp_service->custom_variables;temp_cust=
omvariablesmember!=3DNULL;temp_customvariablesmember=3Dtemp_customvariabl=
esmember->next){
=
asprintf(&customvarname,"_SERVICE%s",temp_customvariablesmember->variable=
_name);
- =
add_custom_variable_to_object(¯o_custom_host_vars,customvarname,temp_=
customvariablesmember->variable_value);
+ =
add_custom_variable_to_object(¯o_custom_service_vars,customvarname,te=
mp_customvariablesmember->variable_value);
my_free(customvarname);
}
}
@@ -3187,7 +3187,7 @@
if((temp_contact=3Dmacro_contact_ptr) && set=3D=3DTRUE){
=
for(temp_customvariablesmember=3Dtemp_contact->custom_variables;temp_cust=
omvariablesmember!=3DNULL;temp_customvariablesmember=3Dtemp_customvariabl=
esmember->next){
=
asprintf(&customvarname,"_CONTACT%s",temp_customvariablesmember->variable=
_name);
- =
add_custom_variable_to_object(¯o_custom_host_vars,customvarname,temp_=
customvariablesmember->variable_value);
+ =
add_custom_variable_to_object(¯o_custom_contact_vars,customvarname,te=
mp_customvariablesmember->variable_value);
my_free(customvarname);
}
}
-END---------------------------------------------------------------------=
------------------------------
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
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_MAC=
RO_CHARS|ESCAPE_MACRO_CHARS),set);
}
- /***** CUSTOM HOST VARIABLES *****/
+ /***** CUSTOM SERVICE VARIABLES *****/
/* generate variables and save them for later */
if((temp_service=3Dmacro_service_ptr) && set=3D=3DTRUE){
=
for(temp_customvariablesmember=3Dtemp_service->custom_variables;temp_cust=
omvariablesmember!=3DNULL;temp_customvariablesmember=3Dtemp_customvariabl=
esmember->next){
=
asprintf(&customvarname,"_SERVICE%s",temp_customvariablesmember->variable=
_name);
- =
add_custom_variable_to_object(¯o_custom_host_vars,customvarname,temp_=
customvariablesmember->variable_value);
+ =
add_custom_variable_to_object(¯o_custom_service_vars,customvarname,te=
mp_customvariablesmember->variable_value);
my_free(customvarname);
}
}
@@ -3187,7 +3187,7 @@
if((temp_contact=3Dmacro_contact_ptr) && set=3D=3DTRUE){
=
for(temp_customvariablesmember=3Dtemp_contact->custom_variables;temp_cust=
omvariablesmember!=3DNULL;temp_customvariablesmember=3Dtemp_customvariabl=
esmember->next){
=
asprintf(&customvarname,"_CONTACT%s",temp_customvariablesmember->variable=
_name);
- =
add_custom_variable_to_object(¯o_custom_host_vars,customvarname,temp_=
customvariablesmember->variable_value);
+ =
add_custom_variable_to_object(¯o_custom_contact_vars,customvarname,te=
mp_customvariablesmember->variable_value);
my_free(customvarname);
}
}
-END---------------------------------------------------------------------=
------------------------------
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]