[Nagiosplug-help] NRPE and check_oracle

Andreas Ericsson ae at op5.se
Tue Jul 12 08:28:48 CEST 2005


Ralph.Grothe at itdz-berlin.de wrote:
> Hi,
> 
> 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
> environment.
> OK this is straight forward as long as I invoke it on the command
> line
> 
> e.g.
> 
> $ uname -srv
> HP-UX B.11.00 U
> 
> $ id -u
> 101
> 
> $ 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
> 

Use a wrapper script to run the check where you set up the proper 
environment first.

> $ 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
> 
> 
> Thanx
> 
> 
> 
> 
> --
> Ralph Grothe (GBII1Gr)
> IT Dienstleistungszentrum Berlin 
> Berliner Strasse 112-115
> D-10713 Berlin
> Phone:   +49 30 9012 6481
> Fax:     +49 30 9012 3151
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP, 
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: Please include plugins version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer




More information about the Help mailing list