[jim at meyering.net: [Pkg-nagios-devel] Bug#358178: x86_64: avoid `Size... > POSIX-guaranteed...' warning]

Ethan Galstad nagios at nagios.org
Wed Mar 22 18:42:33 CET 2006


On 22 Mar 2006 at 15:00, Andreas Ericsson wrote:

> Ethan Galstad wrote:
> > Looks good - I'll commit this to CVS shortly.  A 2.1 release should
> > be out soon once people get a change to test the latest patches I've
> > committed.
> > 
> 
> #define MAX_PLUGINOUTPUT_LENGTH      (332 + (16 * (64 / __WORDSIZE)))
> 
> Since pointers and long's are always words (in the asm sense), it will
> always use an output buffer of maximum size, while keeping it below
> the POSIX-required minimum atomic write(2) size.
> 
> Or better yet, use a tcp-socket listening on either 127.0.0.1 (if you
> intend to port it to Windows some day) or a udp unix socket (if you
> don't. udp is a lot simpler since you don't have the disturbing
> problems of multiplexing connectivity) for feeding results back in.
> That way you can set the receive-buffers to 256K and never worry about
> it again. It would also scale a lot better. In fact, I think I'll
> start hacking on that later today.
> 

Nagios 2.x will be the last version where there is a hard limit on 
the plugin output length.  The Nagios 3.x code has already been 
modified to remove all length restrictions.  Here's the quick rundown 
on how the new 3.x code works...

1.  Plugin output is written to a temp file
2.  Plugin return code and path to the temp file are passed over the 
pipe
3.  The reaper function grabs the plugin output from the temp file 
and then deletes it

The new code works quite well, and there are no inherent limitations 
on output length.  Also, the size of the write should be well less 
than the POSIX limit unless you host name and service description is 
greater than 300 characters.  I have placed an artificial limit of 4K 
for the plugin output in 3.x to prevent runaway plugins from dumping 
megs of data back to Nagios.

P.S. No need to CC me on replies to the list - I get too much mail 
already! :-)

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



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642




More information about the Developers mailing list