inform Plugins about NRPE's version

Ethan Galstad nagios at nagios.org
Mon Aug 13 19:13:35 CEST 2007


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/nrpe-2.8.1-env-programversion.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: 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/




More information about the Developers mailing list