Re: [Nagios-devel] Small read status data patch

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] Small read status data patch

Post by Guest »

Matthias Flacke wrote:
>
> Hello Ethan, hello list,
>
> testing around with multiline plugin output Hendrik and I found that the
> long
> plugin output in extinfo.cgi was cut around 2000 bytes. The reason for that
> restriction is a hardcoded buffer definition in function
> xsddefault_read_status_data:
> char input[2048]="";
>
> I attached a small patch against xsddefault.c to replace '2048' with
> MAX_PLUGIN_OUTPUT_LENGTH. I would prefer this setting instead of
> MAX_INPUT_BUFFER because otherwise numerous buffer definitions will be
> extended and IMO the plugin output length will be likely the longer part
> in future.
>
> Kind regards,
> Matthias
>
>
> ------------------------------------------------------------------------
>
> --- xdata/xsddefault.c.old 2007-06-22 23:33:06.000000000 +0200
> +++ xdata/xsddefault.c 2007-06-22 23:43:43.000000000 +0200
> @@ -680,7 +680,7 @@
> char *input=NULL;
> mmapfile *thefile=NULL;
> #else
> - char input[2048]="";
> + char input[MAX_PLUGIN_OUTPUT_LENGTH]="";
> FILE *fp=NULL;
> #endif
> int data_type=XSDDEFAULT_NO_DATA;
>
>

I'll make the requested change as you suggested. It looks like this
problem was due to some debugging code that I put in the routines over a
year ago to test for a mmap() bug. The debugging code was never
removed, so mmap() wasn't being used. I just changed the code to use
mmap() by default, which should get rid of the line length limitations.
Hopefully it won't break anything.


Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org





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