Hi again Mathieu, I've applied the patch successfully (I actually just went through the xodtemplate.c file and removed the spaces manually, as below. The lines you sent for the host escalation were actually for the host itself! The host escalation's contacts also had a space in the strtok() functions, which explains why a host escalation wouldn't register "Andy Shellam" as a contact name, but would recognise "NetServe Support" as a contact group.
After applying these changes and rebuilding Nagios, nagios -v ... would recognise the service escalations just fine, and they show up in the CGIs as well. ---- Service escalation - line 10251 :- from: for(contact_group=strtok(this_serviceescalation->contact_groups,", ");contact_group!=NULL;contact_group=strtok(NULL,", ")){ to: for(contact_group=strtok(this_serviceescalation->contact_groups,",");contact_group!=NULL;contact_group=strtok(NULL,",")){ Line 10265 :- from: for(contact_name=strtok(this_serviceescalation->contacts,", ");contact_name!=NULL;contact_name=strtok(NULL,", ")){ to: for(contact_name=strtok(this_serviceescalation->contacts,",");contact_name!=NULL;contact_name=strtok(NULL,",")){ ---- ---- Host escalation - line 10605 (not only contacts, not contact_groups is affected for host escalations): from: for(contact_name=strtok(this_hostescalation->contacts,", ");contact_name!=NULL;contact_name=strtok(NULL,", ")){ to: for(contact_name=strtok(this_hostescalation->contacts,",");contact_name!=NULL;contact_name=strtok(NULL,",")){ ---- Regards, Andy Mathieu Gagné wrote: > Hi Andy, > > Andy Shellam wrote: >> >> I'm more inclined to think that the service escalation is wrong in its >> behaviour, but then I could be wrong? >> > > HostEscalation differs from ServiceEscalation as you can see in the > source code: > > File: xdata/xodtemplate.c > > For ServiceEscalation > > Line: 10251 (for contactgroups) > for(contact_group=strtok(this_serviceescalation->contact_groups,", > ");contact_group!=NULL;contact_group=strtok(NULL,", ")){ > > Line: 10265 (for contacts) > for(contact_name=strtok(this_serviceescalation->contacts,", > ");contact_name!=NULL;contact_name=strtok(NULL,", ")){ > > > For HostEscalation > > Line: 10397 (for contactgroups) > for(contact_group=strtok(this_host->contact_groups,",");contact_group!=NULL;contact_group=strtok(NULL,",")){ > > > > Line: 10413 (for contacts) > for(contact_name=strtok(this_host->contacts,",");contact_name!=NULL;contact_name=strtok(NULL,",")){ > > > > > The white-space is considered a field separator for "contact_groups" > in ServiceEscalation but not HostEscalation. > > As an attachment is a patch which fixes this bug. > > And for the records, somebody should cleanup the source code regarding > this field separator glitch. The white-space is considered a field > separator in a lot of places. > > I'm not a C guru so I'm not sure if it's here on purpose or not and if > "fixing" it breaks backward-compatibility. > > -- > Mathie Gagné ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null