check_nrpe gives incorrect output

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
donny_rajvardhan
Posts: 3
Joined: Tue Mar 03, 2020 11:33 pm

check_nrpe gives incorrect output

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe gives incorrect output

Post 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>
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
donny_rajvardhan
Posts: 3
Joined: Tue Mar 03, 2020 11:33 pm

Re: check_nrpe gives incorrect output

Post 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?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_nrpe gives incorrect output

Post by Box293 »

If it works outside of NRPE on that machine then it is a permission / sudoers issue.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
donny_rajvardhan
Posts: 3
Joined: Tue Mar 03, 2020 11:33 pm

Re: check_nrpe gives incorrect output

Post 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>
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe gives incorrect output

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked