Check_oracle_health problem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
junqian1992
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: Check_oracle_health problem

Post by junqian1992 »

Hi,
Yes, Please check the error as below:

[nagios@Nagios.Huawei ~]$ /usr/local/nagios/libexec/check_nrpe -H xxxxxxx -t 30 -c check_oracle_health -a xxxxx tablespace-usage "--tablespace xxxxxx"
CRITICAL - cannot connect to xxxxx. 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 /usr/local/nagios/libexec/check_oracle_health line 6093.
Regards,
JQ
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_oracle_health problem

Post by scottwilkerson »

This actually is a different error.

Did you download the correct file noted on page 2 of this document and place it in the directory before running the script like it said?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
junqian1992
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: Check_oracle_health problem

Post by junqian1992 »

Hi scottwilkerson,
I have something confused. Before i create a post at here, My Nagios XI already existing the check_oracle_health for other server oracle service use and running normal with the check_oracle_health services.
I still need to run again the script (oracleinstall.sh) on the Nagios XI for the new oracle server? (Remark : Nagios XI server without internet access)
Regards,
JQ
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_oracle_health problem

Post by scottwilkerson »

junqian1992 wrote:Hi scottwilkerson,
I have something confused. Before i create a post at here, My Nagios XI already existing the check_oracle_health for other server oracle service use and running normal with the check_oracle_health services.
I still need to run again the script (oracleinstall.sh) on the Nagios XI for the new oracle server? (Remark : Nagios XI server without internet access)
According to your first post, you are now installing the Oracle plugin on a server that is running this check with NRPE

You need to re-run the setup on THAT server, the directions you wollowed will also need to be followed on THAT server because it will need all the packages to run the plugin. With this plugin you cannot just copy the plugin, you but have all the dependencies on the remote server.
junqian1992 wrote:Hi support,
when i copy the check_oracle_health to the server, and grant permission for nagios user to the databases. but when i running the check_oracle_health, it show :

==========================================================================================================
[nagios@Nagios.Huawei ~]$ /usr/local/nagios/libexec/check_nrpe -H xxxxxxxxx -t 30 -c check_oracle_health -a xxxx tablespace-usage "--tablespace xxxxx"
CRITICAL - cannot connect to xxxx. 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/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 13) line 3.
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.
at /usr/local/nagios/libexec/check_oracle_health line 6093.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
junqian1992
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: Check_oracle_health problem

Post by junqian1992 »

Hi scottwilkerson,
I get what you mean, but i check the script oracleinstall.sh are using the wget to download the plugin since my remote server is unable to connect to the internet , i'm manually download and install all the plugin and dependencies.

What plugin and dependencies i installed :
DBD-Oracle-1.74.tar.gz
gdbm-devel-1.10-8.el7.x86_64.rpm
libaio-0.3.109-13.el7.x86_64.rpm
libdb-devel-5.3.21-20.el7.x86_64.rpm
oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
perl-Compress-Zlib-2.021-144.el6.x86_64.rpm
perl-Data-Dumper-2.145-3.el7.x86_64.rpm
perl-devel-5.16.3-292.el7.x86_64.rpm
perl-Digest-1.17-245.el7.noarch.rpm
perl-Digest-SHA-5.85-4.el7.x86_64.rpm
perl-ExtUtils-Install-1.58-292.el7.noarch.rpm
perl-ExtUtils-MakeMaker-6.68-3.el7.noarch.rpm
perl-ExtUtils-Manifest-1.61-244.el7.noarch.rpm
perl-ExtUtils-ParseXS-3.18-3.el7.noarch.rpm
perl-IO-Compress-Base-2.021-144.el6.x86_64.rpm
perl-local-lib-1.008010-4.el7.noarch.rpm
perl-Net-Daemon-0.48-5.el7.noarch.rpm
perl-PlRPC-0.2020-14.el7.noarch.rpm
perl-Test-Harness-3.28-3.el7.noarch.rpm
systemtap-sdt-devel-3.1-3.el7.x86_64.rpm


LD_LIBRARY_PATH=/oracle/product/12.2.0.1/lib:/lib:/usr/lib:/usr/lib64
ORACLE_HOME=/oracle/product/12.2.0.1

I still getting the error:
[nagios@Nagios.Huawei ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.67.36.162 -t 30 -c check_oracle_health -a PGDB tablespace-usage "--tablespace UPAY_TBS"
CRITICAL - cannot connect to PGDB. 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 /usr/local/nagios/libexec/check_oracle_health line 6093.
Regards,
JQ
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_oracle_health problem

Post by scottwilkerson »

Did you see that script installs from CPAN DBD::Oracle and I do not see that installed in your dependency list.

Code: Select all

cpan -i DBD::Oracle
did you see it compiled the plugin which can change things depending on your OS version

Code: Select all

(
	cd check_oracle_health-$PLUGIN_VER
	./configure
	make && make install
)
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
junqian1992
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: Check_oracle_health problem

Post by junqian1992 »

Hi scottwilkerson ,

cpan -i DBD::Oracle
Since my remote server is unable to connect through the internet, i manually download the DBD-Oracle-1.74.tar.gz and installed.

--------------------------------------------------------------------------------------------------------

cd check_oracle_health-$PLUGIN_VER
./configure
make && make install

This plugin already manually download and successfully configure on the remote server, check_oracle_health has been auto generated.
seem like all the thing has been done, but still come out the error :shock: :shock:

[nagios@Nagios.Huawei ~]$ /usr/local/nagios/libexec/check_nrpe -H xxxxxxxxx -t 30 -c check_oracle_health -a xxxxx tablespace-usage "--tablespace xxxxx"
CRITICAL - cannot connect to xxxxx. 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 /usr/local/nagios/libexec/check_oracle_health line 4755.
Regards,
JQ
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_oracle_health problem

Post by scottwilkerson »

Well let's see if it's there

Code: Select all

ls -al /usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so
locate libclntsh.so
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
junqian1992
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: Check_oracle_health problem

Post by junqian1992 »

Hi scottwilkerson,
Sorry for the late reply, Please check as below result,

[root@xxxxxxxxxxx libexec]# ls -al /usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so
-r-xr-xr-x. 1 root root 798808 Mar 1 10:24 /usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so

[root@xxxxxxxxx libexec]# locate libclntsh.so
/home/installer/oracle12c/database/stage/ext/lib/libclntsh.so.12.1
/oracle/product/12.2.0.1/inventory/Scripts/ext/lib/libclntsh.so.12.1
/oracle/product/12.2.0.1/inventory/backup/2017-09-12_05-26-38PM/Scripts/ext/lib/libclntsh.so.12.1
/oracle/product/12.2.0.1/lib/libclntsh.so
/oracle/product/12.2.0.1/lib/libclntsh.so.10.1
/oracle/product/12.2.0.1/lib/libclntsh.so.11.1
/oracle/product/12.2.0.1/lib/libclntsh.so.12.1
/usr/lib/oracle/12.2/client64/lib/libclntsh.so
/usr/lib/oracle/12.2/client64/lib/libclntsh.so.12.1
Regards,
JQ
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_oracle_health problem

Post by scottwilkerson »

It just hit me what may be part of the problem.. In the doc, when you are setting this up on XI, you have to change the command to include these (change per your installation)
ORACLE_HOME=/usr/lib/oracle/12.1/client64
LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib

So, if you are setting this up on a remote machine and calling that via NRPE, this needs to be added to your check_oracle_health command in nrpe.cfg

See page 3-4 of
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked