Re: [Nagios-devel] [Nagios-users] Bug in 3.0.2 with

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

Re: [Nagios-devel] [Nagios-users] Bug in 3.0.2 with

Post by Guest »

Hi,

Andy Shellam wrote:
>
> Good point.
>
> From my amateur experience with C, I know the "," will split the string
> "contactgroup1, contactgroup2" into "contactgroup1" and " contactgroup2"
> (note the space.)

Yes. That's what I thought. :-/

> Whether Nagios would then realise that " contactgroup2" and
> "contactgroup2" should be the same thing, I'm not sure.

strip() is called after the parsing of hostescalation's contactgroups
but not after the parsing of:
- hostescalation's contacts
- serviceescalation's contactsgroups
- serviceescalation's contacts.
- And some other places where comma separated values are authorized like
*_commands. Note however that *_options, *_coords and timeranges should
not need call to strip().

/* strip newline, carriage return, and tab characters from beginning and
end of a string */
void strip(char *buffer)

So the example I gave you before would only work for hostescalation's
contactgroups but not anywhere else.

A cleanup should be done by removing the white-space delimiter and
adding strip() calls where necessary.

--
Mathieu Gagné





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