Page 1 of 1

Re: [Nagios-devel] MAX_PLUGIN_OUTPUT_LENGHT

Posted: Fri Oct 19, 2007 6:50 am
by Guest
[email protected] 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: [email protected]
Website: http://www.nagios.org





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