check_oracle plugin on hp-ux

Im having problems running the check_oracle plugin on HPUX.
It works on 2 linux boxes one suse 10 and one redhat 5.
It seems to only be a problem with HPUX. All the other standard
nrpe plugin checks on the HPUX box seem to be fine.

IF i call the check_oracle script directly on the localhost. it works fine.

#check_oracle --db SID
SID OK - 1 PMON process(es) running

But when I call it via nrpe. I always get the message that the database is down.

I have tried calling the nrpe check from remotely and from localy

RUN FROM THE LOCAL HOST WHERE ORACLE IS RUNNING (as ROOT and NRPE user)…

check_nrpe -H localhost -c check_oracle

RUN FROM REMOTE NAGIOS POLLING HOST…

check_nrpe -H 192.168.XXX.XXX -c check_oracle

with either I get the message…
SID Database is DOWN

I am specifying the SID in the nrpe.cfg file …

command[check_oracle]=/usr/lib/nagios/plugins/check_oracle --db SID

All other nrpe check’s work fine. eg…

/usr/lib/nagios/plugins/check_nrpe -H 192.168.XXX.XXX -c check_load

OK - load average: 0.05, 0.12, 0.27|load1=0.050;15.000;30.000;0; load5=0.120;10.000;25.000;0; load15=0.270;5.000;20.000;0;

/usr/lib/nagios/plugins/check_nrpe -H 192.168.XXX.XXX3 -c check_users

USERS OK - 1 users currently logged in |users=1;5;10;0

Any help here would be greatly appreciated.
Thanks

Hi!

I’d say that your NRPE user (the one with which you are running the NRPE daemon) is lacking the standard environnement variables necessary for oracle to work (like ORACLE_HOME …).
So, you should add them in the .profile of your NRPE user, reload the session (su - NRPE_user) , restart your nrpe daemon and pray for it to work better :slight_smile:

I hope it was the right answer; if not, don’t hesitate to post again :wink:

I found the problem, i just had to supply the full path to grep and ps in the check_oracle script. It seems that using a local shell inherits the paths but coming in via the nrpe daemon it doesnt.

Hey guys,

I am facing a very similar issue with the check_oracle plugin. Need some quick help on this. The tablespace option of the check_oracle does not seem to work for me. The sqlplus is not getting invoked in the nrpe user at all, and neither throwing any error relating to it. I have set the ORACLE_HOME, TNS_ADMIN and other required variables in the .profile but it doesn’t seem to be of any use to the script running. Trying to output the variables through the nrpe user (check_nrpe) is giving a blank expression. And so I had created a simple script querying the date through the sqlplus. And this works perfectly in the local, but through the check_nrpe, it doesn’t give anything. Infact I had set all the environmental variables (which are in the .profile file) inside the script itself. But now also the script doesn’t seem to work when invoked through the check_nrpe plugin.

Any suggestions are mos welcome. Please pardon me if I am missing anything very silly.

Regards,
Sandy…

I’m working on the same issue.

After correcting all the environment variable problems, such as ORACLE_HOME, LD_LIBRARY_PATH, and so-forth, and execute the plugin directly, as both root and nagios user, it works okay. However when execute the plugin through the check_nrpe program nothing happens. I’ve just confirmed that the actual sqlplus command doesn’t execute at all, when executed from the nrpe program which is weird (I confirmed this by creating a dummy table and inserting a single row, but no row is inserted).

Weird…