Page 1 of 2

error in oracle health check script

Posted: Mon Aug 20, 2012 2:42 pm
by maxwellmiranda
i am getting following error while setting up oracle database monitoring service on nagios XI on Linux REHL 6.2

/usr/bin/env TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin LD_LIBRARY_PATH=LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib ORACLE_HOME=/usr/lib/oracle/11.2/client64 /usr/local/nagios/libexec/check_oracle_health --connect "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = sblhau.bose.com)(PORT = 1521)))(CONNECT_DATA =(SID = SBLPRD)))" --username *****--password "*****" --mode tnsping
<
CRITICAL - cannot connect to (DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = sblhau.bose.com)(PORT = 1521)))(CONNECT_DATA =(SID = SBLPRD))). install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200.
at (eval 18) line 3
Compilation failed in require at (eval 18) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/local/nagios/libexec/check_oracle_health line 4755

Re: error in oracle health check script

Posted: Mon Aug 20, 2012 3:20 pm
by maxwellmiranda
i tried the fix mentioned in the oracle plugin installation document but it did not work
the fix in the document is as follows

Common Problems
Nagios reports CRITICAL with the message:
“install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module
DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-threadmulti/
DynaLoader.pm line 230.”
This problem is due to environment variable not being set properly. This Oracle plugin relies on these environment variables being set.
Make you have probably set the variables as indicated above. Also verify that the proper path is being given. Usual paths are:
x86: /usr/lib/oracle/<YOUR ORACLE VERSION>/client
x86_64: /usr/lib64/oracle/<YOUR ORACLE VERSION>/client
See the section about editing the env variables of the services. Make sure the env variables are set to proper value. These can be
verified by actually going to them on the command line.
Nagios gives this error:
CRITICAL - cannot connect to 192.168.5.55:1521. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC
contains: /usr/local/nagios/libexec /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl
This is due to the Perl module not being installed properly. To remedy this problem, execute the following from the command line:
export ORACLE_HOME=<path to your Oracle which was given by the script>
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
cpan -i DBD::Oracle
Page

Re: error in oracle health check script

Posted: Mon Aug 20, 2012 3:49 pm
by scottwilkerson
Can you run the following and post the output

Code: Select all

locate DynaLoader.pm
Also, you did execute the ./oracleinstall.sh like the document said correct?

Re: error in oracle health check script

Posted: Tue Aug 21, 2012 9:04 am
by maxwellmiranda
following is the output

sudo locate DynaLoader.pm
/usr/lib64/perl5/DynaLoader.pm

Re: error in oracle health check script

Posted: Tue Aug 21, 2012 9:54 am
by scottwilkerson
I'm sorry I read the error wrong, run

Code: Select all

locate Oracle.so

Re: error in oracle health check script

Posted: Tue Aug 21, 2012 11:43 am
by maxwellmiranda
nagprod:/home/nagios> locate Oracle.so
/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so

Re: error in oracle health check script

Posted: Tue Aug 21, 2012 1:45 pm
by scottwilkerson
Did you run the following?

Code: Select all

export ORACLE_HOME=<path to your Oracle which was given by the script>
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
cpan -i DBD::Oracle

Re: error in oracle health check script

Posted: Wed Aug 22, 2012 9:19 am
by maxwellmiranda
yes as mentioned in my earlier post...we have executed the commands you mentioned

Re: error in oracle health check script

Posted: Wed Aug 22, 2012 10:56 am
by scottwilkerson
Just to verify, did you receive any errors when running the commands?

Re: error in oracle health check script

Posted: Wed Aug 22, 2012 11:56 am
by maxwellmiranda
NO