Re: [Nagios-devel] inform Plugins about NRPE's version

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] inform Plugins about NRPE's version

Post by Guest »

Sorry I'm so late on getting this patch applied. Its a great idea.
I'll release nrpe 2.9 today with support for two new environment vars:

NRPE_PROGRAMVERSION=2.9
NRPE_MULTILINESUPPORT=1

That should allow you to detect program version and multiline support
easily. Although multiline support was added before the
NRPE_PROGRAMVERSION, so two variables can be viewed as overkill.

Thanks again!

william(at)elan.net wrote:
> If this is done at all, it should be general environment variable which
> says if calling program (nagios or nrpe or something else) can accept
> multi-line result or not. However most of the cases the setup would
> determine that (i.e. I'd imagine there would be separate config option
> for plugins that support it to enable sending multi-line results).
>
> On Sat, 19 May 2007, Gerhard Lausser wrote:
>
>> Hi Ethan and list,
>>
>> as NRPE is now capable to transport multiline text, i thought plugins should
>> be given the chance to decide wether to go with the old one-line output or
>> to profit from the possibility to report at full length.
>> I made a patch for NRPE which can be found at
>> http://people.consol.de/~lausser/nagios ... sion.patch
>> With this patch, NRPE sets an environment variable $NRPE_PROGRAMVERSION
>> which holds it's version number (e.g. "2.8.1") which is inherited by the
>> called plugins. Based on that version, they can then formulate a short or a
>> long output.
>>
>> echo "CRITICAL - 4 errors"
>> if [ -n "$NRPE_PROGRAMVERSION" ]; then
>> echo "1. bla is broken"
>> echo "2. blub has failed"
>> echo "3. hurtz!"
>> echo "4. suelzomat produces more than 1000 suelzes/sec"
>> fi
>>
>>
>> Actually the variable should be something like $NRPE_CANMULTILINE, but as
>> this patch will only appear in releases > 2.8.1, the existence of
>> NRPE_PROGRAMVERSION will mean the same thing.
>>
>> Greetings from munich,
>> Gerhard
>>
>> p.s. i am not sure if this is useful enough to justify patching NRPE, but i
>> am currently writing a plugin which would profit a lot from multiline output
>> and i want to be prepared for Nagios 3.0 without breaking compatibility with
>> the 2.x versions.
>>



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