[Nagios-devel] Patch for bug in 2.0 where members in servicegroup definition are ignored

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Patch for bug in 2.0 where members in servicegroup definition are ignored

Post by Guest »

This is a multi-part message in MIME format.

------=_NextPart_000_0021_01C411D7.DF3379B0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit


The members line in a servicegroup definition is ignored before this
patch. Also adds a new error message for the case where the members line
has an odd number of comma-delimited items (e.g.
"host_name1,service_description1,host_name2" -- where's
service_description2?).

Regards,
Chris


------=_NextPart_000_0021_01C411D7.DF3379B0
Content-Type: application/octet-stream;
name="nagios-servicegroup-members-ignored.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="nagios-servicegroup-members-ignored.patch"

*** ../nagios-orig/xdata/xodtemplate.c Mon Feb 16 20:59:32 2004=0A=
--- xdata/xodtemplate.c Wed Mar 24 19:31:03 2004=0A=
***************=0A=
*** 6493,6498 ****=0A=
--- 6493,6500 ----=0A=
write_to_logs_and_console(temp_buffer,NSLOG_CONFIG_ERROR,TRUE);=0A=
#endif=0A=
free(member_names);=0A=
+ free(host_name);=0A=
+ free(service_description);=0A=
return ERROR;=0A=
}=0A=
=0A=
***************=0A=
*** 6527,6540 ****=0A=
host_name=3DNULL;=0A=
service_description=3DNULL;=0A=
}=0A=
- =0A=
- /* in case there isn't a matching service description... */=0A=
- free(host_name);=0A=
- host_name=3DNULL;=0A=
}=0A=
=0A=
free(member_names);=0A=
}=0A=
=0A=
=0A=
/* process all services that have servicegroup directives */=0A=
--- 6529,6549 ----=0A=
host_name=3DNULL;=0A=
service_description=3DNULL;=0A=
}=0A=
}=0A=
=0A=
free(member_names);=0A=
+ =0A=
+ /* if there were an odd number of items specified =
(host1,service1,host2) */=0A=
+ if(host_name!=3DNULL){=0A=
+ #ifdef NSCORE=0A=
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"Error: servicegroup =
members must be specified in host_name,service_description pairs (config =
file '%s', starting on line =
%d)\n",xodtemplate_config_file_name(temp_servicegroup->_config_file),temp=
_servicegroup->_start_line);=0A=
+ temp_buffer[sizeof(temp_buffer)-1]=3D'\x0';=0A=
+ write_to_logs_and_console(temp_buffer,NSLOG_CONFIG_ERROR,TRUE);=0A=
+ #endif=0A=
+ free(host_name);=0A=
+ return ERROR;=0A=
}=0A=
+ }=0A=
=0A=
=0A=
/* process all services that have servicegroup directives */=0A=

------=_NextPart_000_0021_01C411D7.DF3379B0--






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked