Ajay sharma
Ajay sharma

Reputation: 1

install_driver(Oracle) failed: Can't load '/usr/local/lib/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.11.1

I am facing this error from two days. I'am able to get output from via command line at nagios end

/usr/local/nagios/libexec/check_oracle_health --connect 192.168.2.92:1521/modula --user nagios --password nagios --mode tnsping

Output is

OK - connection established to 192.168.2.92:1521/modula.

But when I am going to GUI mode it is giving me error

CRITICAL - cannot connect to 192.168.2.92:1521/modula.
install_driver(Oracle) failed: 
Can't load '/usr/local/lib/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/lib/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 5837
\n

Plese help me to resolve the error.

Upvotes: 0

Views: 7437

Answers (2)

izem
izem

Reputation: 413

The answer by Jordan Neufeld is good and may be enough for you (I've tested it on CentOS 7), but I recommend setting these environment variables:

export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib/oracle/11.2/client64/bin:$PATH

[examples are for oracle-instantclient11.2-basic-11.2 rpm, change path if needed]

Upvotes: 1

Jordan Neufeld
Jordan Neufeld

Reputation: 13

I had this issue on CentOS 6 and here is how I resolved it:

`echo "$ORACLE_HOME/lib" >> /etc/ld.so.conf.d/oracle-x86_64.conf && ldconfig` 

Upvotes: 1

Related Questions