Increasing the plugin output buffer

I’m attempting to get the check_multi plugin working through nrpe. To do so, I have to increase the buffer check_result buffer size both in nagios and nrpe.

I’ve sucessfully recompiled nagios, but nrpe continues to be a challenge. I edited the common.h file and changed MAX_INPUT_BUFFER and MAX_PACKETBUFFER_LENGTH to be 16384 (16 bits). It compiles without error as well as starts, but attempting to connect to the daemon always results in a :

Sep 22 14:27:05 *** nrpe[7099]: Error: Request packet had invalid CRC32.
Sep 22 14:27:05 *** nrpe[7099]: Client request was invalid, bailing out…

I’ve tried using the recompiled plugin as well and it seems that it only likes to work with the default buffer size.

Has anyone made this mod?

Yep, by default, nagios 2.x has a message response size a lot smaller than NRPE. You can increase that size up to NRPE’s and then recompile nagios, but no further in my experience.

If you tcpdump an NRPE conversation, they all have the exact same size. It has a defined message length, and if your plugin output doesn’t fill that message length, it just fills the rest with null characters.

I’m guessing something in the NRPE code looks for a specific message length, throws it through its encryption functions, and then totally bails if it’s the wrong length. But i’m not a programmer, maybe you can hack through it.

We ended up upgrading to Nagios 3.x for multi-line support, and all of our output fits through NRPE…not sure what else you can do!