check_oracle_health not working for Linux env

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Amit_Alone
Posts: 89
Joined: Fri May 08, 2020 11:47 am

check_oracle_health not working for Linux env

Post by Amit_Alone »

Hi Team,

We are using nagios XI 5.7.1 and one of our client installed the Oracle 12.2 v on Linux env and requested us to monitor the Oracle Table space but after configuring the alert it is displaying the error (Service check timed out after 60.01 seconds).
However, we have extended the check_interval by -t 120 but still observing the same error.
I have run the below cmd on the terminal and it is

Code: Select all

[root@avgdXXXXX libexec]# ./check_oracle_health --connect '10.183.XX.XXX:1525/PAAXXX' --username 'nagios' --password 'XXXXXXXXXXX' --mode tablespace-usage --warning 90 --critical 98 -t 120
CRITICAL - cannot connect to 10.183.XX.XXX:1525/PAAXXX. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
 at (eval 13) line 3.
Compilation failed in require at (eval 13) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at ./check_oracle_health line 6155.
Please help me for resolving this issue. I have gone though many forum regarding same error but none of them was able to solve the problem.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_oracle_health not working for Linux env

Post by lmiltchev »

Can you run the following two commands and show the output?

Code: Select all

cat /usr/local/nagiosxi/etc/configwizards/oracle/oracle
perl -MDBD::Oracle -le 'print $DBD::Oracle::VERSION'
Be sure to check out our Knowledgebase for helpful articles and solutions!
Amit_Alone
Posts: 89
Joined: Fri May 08, 2020 11:47 am

Re: check_oracle_health not working for Linux env

Post by Amit_Alone »

Hi Lmiltchev,

As requested, please refer the o/p of the shared command.

Code: Select all

[root@avgdlnxvp126 ~]# cat /usr/local/nagiosxi/etc/configwizards/oracle/oracle
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib
export ORACLE_HOME=/usr/lib/oracle/11.2/client
[root@avgdlnxvp126 ~]# perl -MDBD::Oracle -le 'print $DBD::Oracle::VERSION'
Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
 at -e line 0.
Compilation failed in require.
BEGIN failed--compilation aborted.
[root@avgdlnxvp126 ~]#
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_oracle_health not working for Linux env

Post by lmiltchev »

There is a mismatch between the version of the Oracle client that you installed and the one, listed in the "/usr/local/nagiosxi/etc/configwizards/oracle/oracle" file...
We are using nagios XI 5.7.1 and one of our client installed the Oracle 12.2 v on Linux env and requested us to monitor the Oracle Table space but after configuring the alert it is displaying the error (Service check timed out after 60.01 seconds).
[root@avgdlnxvp126 ~]# cat /usr/local/nagiosxi/etc/configwizards/oracle/oracle
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib
export ORACLE_HOME=/usr/lib/oracle/11.2/client
Try modifying the oracle file with the correct version to see if this is going to fix your issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Amit_Alone
Posts: 89
Joined: Fri May 08, 2020 11:47 am

Re: check_oracle_health not working for Linux env

Post by Amit_Alone »

Hi Lmiltchev,

As per suggestion I have made the changes in the file. But still observing the same error.

Code: Select all

[root@avgdlnxvp126 tmp]# cat /usr/local/nagiosxi/etc/configwizards/oracle/oracle
export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client/lib
export ORACLE_HOME=/usr/lib/oracle/12.2/client

Code: Select all

[root@avgdlnxvp126 libexec]# ./check_oracle_health --connect '10.183.XX.XXX:1525/PAAXXX' --username 'nagios' --password 'XXXXXXXX' --mode tablespace-usage --warning 90 --critical 98 -t 120
CRITICAL - cannot connect to 10.183.XX.XXX:1525/PAAXXX. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
 at (eval 13) line 3.
Compilation failed in require at (eval 13) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at ./check_oracle_health line 6155.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_oracle_health not working for Linux env

Post by lmiltchev »

Run the following command to try to reinstall the DBD::Oracle module via cpan:

Code: Select all

cpan -i DBD::Oracle
Did this help?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Amit_Alone
Posts: 89
Joined: Fri May 08, 2020 11:47 am

Re: check_oracle_health not working for Linux env

Post by Amit_Alone »

I run the shared command and still observing the same error. Below is the cpan warning I got at the end after completion of the command.

Code: Select all

# *** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***
#
# The following REQUIRED prerequisites were not satisfied:
#
# Test::NoWarnings is not installed (any version required)
# Test::NoWarnings is not installed (any version required)
#
t/00-report-prereqs.t ..... ok
t/00dbdoracletestlib.t .... 1/? Bailout called.  Further testing stopped:  DBDOracleTestLib require problem... impossible to proceed

#   Failed test 'require DBDOracleTestLib;'
#   at t/00dbdoracletestlib.t line 11.
#     Tried to require 'DBDOracleTestLib'.
#     Error:  Can't load '/root/.cpan/build/DBD-Oracle-1.80-SiOwsC/blib/arch/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
#  at t/lib/DBDOracleTestLib.pm line 29.
# Compilation failed in require at t/lib/DBDOracleTestLib.pm line 29.
# BEGIN failed--compilation aborted at t/lib/DBDOracleTestLib.pm line 29.
# Compilation failed in require at (eval 4) line 2.
# Tests were run but no plan was declared and done_testing() was not seen.
FAILED--Further testing stopped: DBDOracleTestLib require problem... impossible to proceed
make: *** [test_dynamic] Error 255
  MJEVANS/DBD-Oracle-1.80.tar.gz
  /bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MJEVANS/DBD-Oracle-1.80.tar.gz
Running make install
  make test had returned bad status, won't install without force
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_oracle_health not working for Linux env

Post by lmiltchev »

I am not sure why the module won't compile... It could be because of dependencies. I don't like using the "force" option, and I wouldn't recommend it. Let's try to install the "Test::NoWarnings" module to see if this would help.

Code: Select all

cpan -i Test::NoWarnings
cpan -i DBD::Oracle
Did it compile now?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Amit_Alone
Posts: 89
Joined: Fri May 08, 2020 11:47 am

Re: check_oracle_health not working for Linux env

Post by Amit_Alone »

Still compile was not got processes successfully.

Code: Select all

#   Failed test 'require DBDOracleTestLib;'
#   at t/00dbdoracletestlib.t line 11.
#     Tried to require 'DBDOracleTestLib'.
#     Error:  Can't load '/root/.cpan/build/DBD-Oracle-1.80-Tbe2An/blib/arch/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
#  at t/lib/DBDOracleTestLib.pm line 29.
# Compilation failed in require at t/lib/DBDOracleTestLib.pm line 29.
# BEGIN failed--compilation aborted at t/lib/DBDOracleTestLib.pm line 29.
# Compilation failed in require at (eval 8) line 2.
Bailout called.  Further testing stopped:  DBDOracleTestLib require problem... impossible to proceed
FAILED--Further testing stopped: DBDOracleTestLib require problem... impossible to proceed
make: *** [test_dynamic] Error 255
  MJEVANS/DBD-Oracle-1.80.tar.gz
  /bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MJEVANS/DBD-Oracle-1.80.tar.gz
Running make install
  make test had returned bad status, won't install without force
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_oracle_health not working for Linux env

Post by lmiltchev »

Run the following command:

Code: Select all

ls -laR /usr/lib/oracle > /tmp/oracle
then post on the forum the "oracle" file that was created in the "/tmp" directory.

Also, post the output of:

Code: Select all

echo $ORACLE_HOME
echo $LD_LIBRARY_PATH
What is the OS/distro on the system that you tried to install the Oracle client on?

Code: Select all

uname -a
cat /etc/*release
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked