Page 1 of 1
check_nrpe gives incorrect output
Posted: Tue Mar 03, 2020 11:42 pm
by donny_rajvardhan
Hello,
I've been scratching my head over this , i hope i'll find a suggestion here.
On the remote machine <nrpe_home>/libexec/check_oracle --db <SID> , shows database is up, But
<nrpe_home>/libexec/check_nrpe -H localhost -c check_oracle_<SID> , reports database is down.
In nrpe.cfg , the command is defined as:
commnd[check_oracle_<SID>]=/opt/nrpe/libexec/check_oracle --db <SID>
Any Ideas?
Re: check_nrpe gives incorrect output
Posted: Wed Mar 04, 2020 5:26 pm
by scottwilkerson
I'm not really familiar with this plugin but you need to make sure the ORACLE_HOME is set in the command as when nrpe runs the command it isn't going to get the users environment
Something like the following (changing to your correct paths):
Code: Select all
command[check_oracle_<SID>]=LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib ORACLE_HOME=/usr/lib/oracle/11.2/client /opt/nrpe/libexec/check_oracle --db <SID>
Re: check_nrpe gives incorrect output
Posted: Wed Mar 04, 2020 11:23 pm
by donny_rajvardhan
Tried this, still getting the same O/P.
Strange, that it reports "Database UP" for other SID's.
A total of 8 SID's are there, 2 of which are reported as DOWN by check_nrpe.
Though ORA_PMON_<SID> exists for each of these SID's.
Should i be using some other Nagios Plugin for Oracle DB monitoring? Any recommendations?
Re: check_nrpe gives incorrect output
Posted: Thu Mar 05, 2020 8:21 pm
by Box293
If it works outside of NRPE on that machine then it is a permission / sudoers issue.
Re: check_nrpe gives incorrect output
Posted: Fri Mar 06, 2020 12:28 am
by donny_rajvardhan
Okay, Got it working.
bash-3.2$ ./libexec/check_nrpe -H localhost -c print_env
_=/usr/bin/env
NRPE_PROGRAMVERSION=2.12
NRPE_MULTILINESUPPORT=1
PWD=/
TZ=IST-5:30
PATH was not set?
Had to set PATH along with command definition:
command[check_oracle_<SID>]=PATH=/usr/bin:<ORACLE_HOME>/bin /opt/nrpe/libexec/check_oracle --db <SID>
Strange that command definition without PATH for another SID works fine
command[check_oracle_<SID2>]=/opt/nrpe/libexec/check_oracle --db <SID2>
Re: check_nrpe gives incorrect output
Posted: Fri Mar 06, 2020 4:19 pm
by scottwilkerson
donny_rajvardhan wrote:Okay, Got it working.
bash-3.2$ ./libexec/check_nrpe -H localhost -c print_env
_=/usr/bin/env
NRPE_PROGRAMVERSION=2.12
NRPE_MULTILINESUPPORT=1
PWD=/
TZ=IST-5:30
PATH was not set?
Had to set PATH along with command definition:
command[check_oracle_<SID>]=PATH=/usr/bin:<ORACLE_HOME>/bin /opt/nrpe/libexec/check_oracle --db <SID>
Strange that command definition without PATH for another SID works fine
command[check_oracle_<SID2>]=/opt/nrpe/libexec/check_oracle --db <SID2>
Glad to hear you got it working!
Locking thread