[Nagiosplug-help] NRPE and check_oracle

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Tue Jul 12 03:09:50 CEST 2005


after having managed to build the plugins from the sources on
HPUX 11.00 I am about to configure nrpe.cfg

As you can see, this box is not the Nagios server but a monitored
(managed) node whose nrpe daemon (spawned through inetd) shall
transmit the return codes of plugins run on this node via NRPE.

Thus I don't have a nagios.cfg or the like on this node.

Starting with the check_oracle plugin (as this node is a DB
server) I now tripped over the minor problem of how to setup the
ORACLE environment for this plugin.

Unfortunately the "documentation" of the plugin (unless you are
into sifting through the source code) is quite sparse, and so I'm
left with what the --help screen displays

>From it I found that the plugin requires a minimal ORACLE
OK this is straight forward as long as I invoke it on the command


$ uname -srv
HP-UX B.11.00 U

$ id -u

$ ORACLE_HOME=/app/oracle/product/9.2.0
PATH=/usr/bin:$ORACLE_HOME/bin /usr/local/nagios/libexec/chec>
OK - reply time 30 msec from FREMD

However, how is the nrpe daemon getting its environment.
I don't want to set up a specicific Oracle (or whatever the next
plugin calls for) environment for the user as indicated in
inetd.conf for nrpe

$ grep ^nrpe /etc/inetd.conf
nrpe    stream tcp nowait nagios /opt/nrpe/bin/nrpe nrpe -c
/opt/nrpe/etc/nrpe.cfg --inetd

Aprops, as I'm on the subject, the README of nrpe didn't specify
the daemon's name as ARGV[0] but started right
with -c ...
However, the HPUX inetd expects the program name of the daemon it
spawns in arg position 0,
as the manpage points out (which seems to me in accordance to C
programming conventions)

Can I simply define environment vars in nrpe.cfg?
Or should one setup a resources.cfg wherein one would define
$USER#$ macros?

I know that I could define the environment simply in the user's
$HOME/.profile for instance.
But I don't want this as it could happen that such a user even
doesn't posses a $HOME (aka 6th field in /etc/passwd) for obvious
reasons (even though this might breach Unix conventions).

$ awk -F: '$1=="nagios"{print$6}' /etc/passwd


Ralph Grothe (GBII1Gr)
IT Dienstleistungszentrum Berlin 
Berliner Strasse 112-115
D-10713 Berlin
Phone:   +49 30 9012 6481
Fax:     +49 30 9012 3151

More information about the Help mailing list