inform Plugins about NRPE's version

Gerhard Lausser Gerhard.Lausser at consol.de
Sat May 19 22:33:01 CEST 2007


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.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/




More information about the Developers mailing list