oracle monitoring error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lafargeuser
Posts: 341
Joined: Thu Sep 27, 2012 12:23 am

oracle monitoring error

Post 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....
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: oracle monitoring error

Post by hsmith »

Could you link the document that you tried to follow?
Former Nagios Employee.
me.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: oracle monitoring error

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: oracle monitoring error

Post 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.
kranthi6
Posts: 13
Joined: Mon Sep 10, 2012 2:43 am

Re: oracle monitoring error

Post 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
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: oracle monitoring error

Post 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
kranthi6
Posts: 13
Joined: Mon Sep 10, 2012 2:43 am

Re: oracle monitoring error

Post 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!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: oracle monitoring error

Post by rkennedy »

Can you please post the related service definition that the check is using?
Former Nagios Employee
kranthi6
Posts: 13
Joined: Mon Sep 10, 2012 2:43 am

Re: oracle monitoring error

Post 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!
Locked