[Nagiosplug-help] "check_nrpe -H 10.x.x.x -c check_ora_tns" ----> "ERROR: CANNOT DETERMINE ORACL
nathan.vonnahme at bannerhealth.com
Tue Apr 1 20:47:30 CEST 2008
Right. When you run it from the Nagios user's shell, you have a bunch
of environment variables set, but when NRPE runs it it's probably pretty
environmentless, like a script run by crond.
`env - [commands]` simulates how crond or nrpe or xinetd will run your
script so it's a good trick for problems like this.
From: Justin Amburn [mailto:justinjoseph24 at hotmail.com]
Sent: Monday, March 31, 2008 8:39 PM
To: Vonnahme, Nathan
Cc: nagiosplug-help at lists.sourceforge.net
Subject: Re: [Nagiosplug-help] "check_nrpe -H 10.x.x.x -c check_ora_tns"
----> "ERROR: CANNOT DETERMINE ORACL
The problem was that xinetd has its own environment vars that were not
being passed until I told it to do so. Now I can run './check_nrpe -H
10.200.2.50 -c check_db' with nrpe config alias as:
check_db=/usr/local/nagios/libexec/check_oracle --db DBPRD
but I cannot have the alias as:
check_db=/usr/local/nagios/libexec/check_oracle --db $ORACLE_SID
it passes an empty variable to the program. but only if it's run
remotely from nagios very strange. It works when logged in as nagios
running locally. I'm not even attempting to pass any $ARGS$.
Vonnahme, Nathan wrote:
> Why do you have redundant "export" statements?
> On the remote machine, try manually running the check with a blank
> enviroinment, e.g.
> env - /usr/local/nagios/libexec/check_oracle --tns DBPRD
> *From:* nagiosplug-help-bounces at lists.sourceforge.net
> [mailto:nagiosplug-help-bounces at lists.sourceforge.net] *On Behalf Of
> *Justin Amburn
> *Sent:* Thursday, March 27, 2008 8:47 PM
> *To:* nagiosplug-help at lists.sourceforge.net
> *Subject:* [Nagiosplug-help] "check_nrpe -H 10.x.x.x -c check_ora_tns"
> ----> "ERROR: CANNOT DETERMINE ORACLE_HOME FOR SID xxxxx"
> In the beginning of the check_oracle script I added:
> export PATH=$PATH:/u1/apps/oracle/product/10.2.0/bin;export PATH
> export ORACLE_HOME=/u1/apps/oracle/product/10.2.0;export ORACLE_HOME
> export ORACLE_SID=BABYCPRD;export ORACLE_SID
> What am I doing wrong???
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Help