Small read status data patch

Ethan Galstad nagios at nagios.org
Mon Jul 16 17:47:43 CEST 2007


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: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/




More information about the Developers mailing list