MAX_PLUGIN_OUTPUT_LENGHT

Ethan Galstad nagios at nagios.org
Fri Oct 19 16:50:52 CEST 2007


pozda at tiscali.cz wrote:
> Description of my test:
> 1) I change MAX_PLUGIN_OUTPUT_LENGHT to 8192, recompile nagios
> 2) restart nagios
> 3) send very long string to external file 
> /usr/bin/printf "[%lu] PROCESS_SERVICE_CHECK_RESULT;martin-xp;Backup;0;$string"
> $now  > $commandfile
> 
> The nagios trimps my $string to 957 bytes. It seems, that nagios trimps string
> to 1024 and 67 bytes is header.
> 
> I have only some minutes to go throuth sources and I found some buffer,s
> that are defined directly for instance
> common\snprintf line 1267
>         char buf1[1024]; 
> 	char buf2[1024]; 
> 
> And there are many other constant defined to 1024 
> 
> cgi\extinfo  #define MAX_MESSAGE_BUFFER    1024
> cgi\status.c MAX_MESSAGE_BUFFER 1024
> include\comon.h #define MAX_INPUT_BUFFER 1024
> 
> When I blindly change some of then, I was able to send to nagios message
> 4033 bytes long.
> 
[snip]

The external command length was limited to 1024 because of 
MAX_INPUT_BUFFER.  Effective length was a bit lower (957) because of the 
text preceding the passive result.  For example: "[1234566] 
PROCESS_SERVICECHECKRESULT;host;svc;..."

I changed the external command buffer to 8k, upped the plugin cap to 8k 
as well and made a note in the include file about changing both values 
if someone needs to go beyond 8k in the future.

Fix will be in CVS shortly.

Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/




More information about the Developers mailing list