BUG: servicegroup and (Return code of 127 is out of bounds - plugin may be missing) in status information

Jochen Bern Jochen.Bern at LINworks.de
Tue May 10 09:31:16 CEST 2011


On 05/09/2011 09:10 PM, Roberto Oppedisano wrote:
> AFAIK we don't use environment variables (and grepping for NAGIOS in the
> config file led me only to commented out strings).

(FWIW, it would be the executables (!) spawned from Nagios - plugins,
event handlers, yadda yadda - who would (try to) retrieve data from
their environment. The *Nagios config* only determines whether Nagios
(the executable) should go ahead and fill the environment for them or
not, so you won't find any individual env vars there. As an example,
here's the beginning of a notification-sending shell script which I
initially had read the env vars, and later had to modify to accept the
data from the command line instead:

> [root at nagios ~]# head -26 /usr/local/nagios/libexec/notify-hostonly-override.mailx
> #!/bin/sh
> 
> # How to log. Note that Nagios is hardcoded (!) to user.info ...
> LOGGER="logger -t `basename $0` -p user"
> 
> # These are the env vars controlling our actions
> SLA="$NAGIOS__HOSTSLA"
> SRV="$NAGIOS__SERVICEIMPORTANT"
> 
> # If you have the env vars disabled, you can pass the data via command
> # line, as follows:
> # --explicit-params "$HOSTNAME$" "$SERVICEDESC$" "$_HOSTSLA$ "$_SERVICEIMPORTANT$"
> # Note that this needs to *precede all* params passed to the mail command.
> if [ "$1" = "--explicit-params" ]; then
>    HNAME="$2"
>    SRVDESC="$3"
>    SLA="$4"
>    SRV="$5"
>    shift 5
> elif [ "$NAGIOS_HOSTNAME" = "" -o "$NAGIOS_HOSTNAME" = '$' ]; then
>    # Try to catch someone calling us manually ...
>    echo "This script should NOT be called manually ..." > /dev/stderr
> else
>    HNAME="$NAGIOS_HOSTNAME"
>    SRVDESC="$NAGIOS_SERVICEDESC"
> fi

Kind regards,
								J. Bern)
-- 
Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay




More information about the Developers mailing list