Page 1 of 1

Check_oracle | NRPE issue

Posted: Fri Jul 14, 2017 11:15 am
by anish
Hello,

I am trying to monitor DB instances running on HP-UNIX server using check_oracle.sh plugin.
User nagios is part of dba group.
plugin is working perfectly when i execute it directly, but it doesn't run when called using check_nrpe.

Code: Select all

# ./check_nrpe -H localhost -c check_oracle_db
opspb10p Database is DOWN
usplops1:<root>[/usr/local/nagios/libexec]
# ./check_ora.sh --db 'opspb10p'
opspb10p OK - 1 PMON process(es) running
I have tried running check_nrpe - from Nagios user/root user/ DB user but everytime i get same output.

NRPE.CFG

Code: Select all

TRIED:
command[check_oracle_db]=/usr/bin/env LD_LIBRARY_PATH=/app4p/oracle/product/10.2/lib /usr/local/nagios/libexec/check_ora.sh --db 'opspb10p'
command[check_oracle_db]=/usr/local/nagios/libexec/check_ora.sh --db 'opspb10p'
Output:
opspb10p Database is DOWN

command[check_oracle_db]=/usr/local/nagios/libexec/check_ora.sh --db 'opspb10p'
Output:Unable to read output
Kindly help!

Re: Check_oracle | NRPE issue

Posted: Fri Jul 14, 2017 12:11 pm
by lmiltchev
It seems like that the plugin is working as expected, when you run it as root:
# ./check_ora.sh --db 'opspb10p'
opspb10p OK - 1 PMON process(es) running
Before troubleshooting NRPE, can you verify that you can run the same plugin as nagios user?

Code: Select all

su - nagios
/usr/local/nagios/libexec/check_ora.sh --db 'opspb10p'

Re: Check_oracle | NRPE issue

Posted: Sat Jul 15, 2017 11:56 am
by anish
Yes...with nagios user, plugins returns the same output.

But only when i run using nrpe irrespective of any user, it fails.

I would also like to highlight here that there are other common plugins such as CPU/DISK/MEMORY which are running as usual under check_nrpe.

Re: Check_oracle | NRPE issue

Posted: Sun Jul 16, 2017 4:42 pm
by SteveBeauchemin
If I remember correctly the default NRPE Install on HPUX runs as the NRPE user. Is that still true? What user does NRPE run as?

Steve B

Re: Check_oracle | NRPE issue

Posted: Mon Jul 17, 2017 12:15 pm
by anish
There is no NRPE user on this host HPUX (11.11)

Code: Select all

NRPE_USER = nagios
NRPE v2.12
Kindly suggest the possible solution to this issue.

Re: Check_oracle | NRPE issue

Posted: Mon Jul 17, 2017 12:35 pm
by tgriep
Can you post the plugin from your HPUX system so we can view it?

Code: Select all

/usr/local/nagios/libexec/check_ora.sh
Then run the following commands and post the output.

Code: Select all

env
su - nagios
env

Re: Check_oracle | NRPE issue

Posted: Mon Jul 17, 2017 12:54 pm
by SteveBeauchemin
On my HPUX, I run nrpe via the inetd.

Code: Select all

tail -3 /etc/inetd.conf

# Nagios NRPE agent
nrpe    stream  tcp     nowait  nrpe  /opt/nrpe/bin/nrpe nrpe -i -c /opt/nrpe/etc/nrpe.cfg
and from the nrpe.cfg file I see

Code: Select all

cat /opt/nrpe/etc/nrpe.cfg

# NRPE USER
# This determines the effective user that the NRPE daemon should run as.
# You can either supply a username or a UID.
#
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd
nrpe_user=nagios
So, even though one cfg file says nagios, that is ignored if using inetd.
That is why I asked about the user that runs. Just to cover all the turf.

Good Luck...
Steve B

Re: Check_oracle | NRPE issue

Posted: Mon Jul 17, 2017 4:08 pm
by ssax
Please attach your /usr/local/nagios/libexec/check_ora.sh so that we can review it, the majority of the time it's because of path issues.

Thank you