MAX_PLUGIN_OUTPUT_LENGHT

Martin Pozdílek pozda at mfservis.cz
Mon Oct 22 14:12:38 CEST 2007


Hi

I have played with nagios whole weekend and I have several points for
discussion.

1) MAX_PLUGIN_OUTPUT_LENGTH and multiple line output features work well
only for local scripts called directly by Nagios.

2) External command file doesn't support multiple line output (nagios
read only first line). The message length is limited too. I increased
MAX_INPUT_BUFFER
and MAX_PLUGIN_OUTPUT_LENGTH to 8192, but maximum length of message put
to Nagios through external command file is still limited to 4KB. I don't
know why. It seems, that should be expand another constant.

3) Almost all services in my configuration are checked remotly. I can
use NSCA or NRPE for remote monitoring servers.  The problem is, that
NSCA and NRPE don't support
multipline output (not so important for me) as well as messages longer
that 1024 bytes. The syntax of send_nsca is not compatible with
multiline support.

I know I can increase some constants in NSCA and NRPE source codes and
compile them on linux. But how I can do this on windows, aix ..? 
There are many precompiled plugins and deamons without source codes on
NagiosExchange. So I cannot modify the lenght of message for them.

The result is: If  I want to checked some services remotely, I have to
reconcile with 1024 bytes long output on one line.

4) I believe that point 2 is not so difficult to correct. May be it's
already done in CSV.

The long term problem is point 3. I suggest to incorporate length of
buffer to configuration file of NSCA, NRPE clients and servers.
As well as you can specify port number, you could specify maximum 
length of message.
I know it's long time change requiered different way of allocation
memory ... , but it will fully enabled nagios's new feature - multiple
line output of "large" size.

Or anyone can suggest better solution. But I think today's situation
should be solved in future.

Martin

Ethan Galstad napsal(a):
> 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/
> _______________________________________________
> Nagios-devel mailing list
> Nagios-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-devel
>   


-------------------------------------------------------------------------
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