Page 1 of 2

oracle monitoring error

Posted: Mon Sep 14, 2015 10:39 am
by lafargeuser
CRITICAL - cannot connect to ip:port/sn002050. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/pera


tried following your document but no luck....

Re: oracle monitoring error

Posted: Mon Sep 14, 2015 10:45 am
by hsmith
Could you link the document that you tried to follow?

Re: oracle monitoring error

Posted: Mon Sep 14, 2015 2:01 pm
by lafargeuser

Re: oracle monitoring error

Posted: Mon Sep 14, 2015 4:31 pm
by tgriep
The document has instructions for resolving that error, can you try it again and see if that fixes it for you?

This is due to the Perl module not being installed properly. To remedy this problem, execute the following from the command line:

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: oracle monitoring error

Posted: Mon Sep 14, 2015 4:33 pm
by ssax
From the guide:

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
Did you do this? If so, please post the full output of the cpan command.

Re: oracle monitoring error

Posted: Tue Mar 29, 2016 9:25 pm
by kranthi6
Hi All,

I apologize for posting here as this is someone's post, but I am having similar issues. I have executed all the steps as mentioned in the document: https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Error:
CRITICAL - cannot connect to 142.xx.xxx.xxx:1521/SGRC. install_driver

(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC contains:

/usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5

/usr/lib64/perl5/vendor_perl /usr/share/perl5/
Perhaps the DBD::Oracle perl module hasn't been fully installed,
or perhaps the capitalisation of 'Oracle' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge, mysql.
at /usr/local/nagios/libexec/check_oracle_health line 4755

I have also performed the troubleshooting steps provided in the document.
export ORACLE_HOME=/usr/lib/oracle/12.1/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
cpan -i DBD::Oracle


The snapshot of the error message is below (attached the full output from cpan too)
CPAN error:
Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site]
PYTHIAN/DBD-Oracle-1.74.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install

Nagios XI version: 5.2.5

Instant Client versions used:
Version 12.1.0.2.0
i. oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
ii.oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
iii.oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm

Server Details:
uname -a
Linux testserver1100 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/*release*

LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
cat: /etc/lsb-release.d: Is a directory
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Red Hat Enterprise Linux Server release 6.5 (Santiago)
cpe:/o:redhat:enterprise_linux:6server:ga:server

Re: oracle monitoring error

Posted: Wed Mar 30, 2016 1:15 pm
by ssax
Try this and see if it resolves it for you:

Code: Select all

export ORACLE_HOME=/usr/lib/oracle/12.1/client64/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/12.1/client64/lib/
export PATH=$PATH:/usr/lib/oracle/12.1/client64/bin
cpan -i DBD::Oracle

Re: oracle monitoring error

Posted: Wed Mar 30, 2016 1:44 pm
by kranthi6
Hi ssax,

You are star! I could complete the installation successfully.

Now I am encountering another error: CRITICAL - cannot connect to xx.xx.xxx.xx:1521/SGRC. ORA-12514: TNS:listener does not currently know of service requested in connect descriptor (DBD ERROR: OCIServerAttach)

Please share your thoughts!

Re: oracle monitoring error

Posted: Wed Mar 30, 2016 3:25 pm
by rkennedy
Can you please post the related service definition that the check is using?

Re: oracle monitoring error

Posted: Fri Apr 01, 2016 6:18 pm
by kranthi6
Hi rkennedy,

Do you mean the service command? Here it is:
check_xi_oracletablespace!--connect 'xxx.xx.xx.xxx:1521/SGRC' --username 'test' --password 'ptest' --mode tablespace-usage --warning 90 --critical 98

Thank you!