Prerequisites for check_oracle_health plugins

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Prerequisites for check_oracle_health plugins

Post by rtsupport »

Hi Team,

Currently we are working on build a new gearmand worker server on RHEL 7 . (Part of Migration)

So far I have done -- ( Will user worker for site specific basis )
>> Gearmand server installed on Nagios XI server. (Nagios XI 5.5.2)
>> Gearmand worker installed on worker server. (RHEL 7.5 (Maipo) )

>> nrpe client installed on worker server. Referring - https://assets.nagios.com/downloads/nag ... _Agent.pdf
>> worker.conf and module.conf has been updated on worker and Nagios server respectively.
>> All existing plugins has been copied to new worker server under /usr/local/nagios/libexec/
>> Few below basic packages are installed referring -- https://support.nagios.com/kb/article.php?id=569#RHEL
postgresql-devel
check_radius
openldap-devel
mariadb-devel mariadb-libs
bind-utils
samba-client
openssh-clients

now to make executable "check_oracle_health plugins" plugins we have to install oracle client, DBD, DBI. Referring -- https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Copied latest rpm in /tmp
oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm
oracle-instantclient18.3-devel-18.3.0.0.0-1.x86_64.rpm
oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.x86_64.rpm

and while running "oracleinstall.sh" script we are getting below error. Please share your thoughts what and where we have to work to fix this.
Error:

Code: Select all

Looking for CPAN mirrors near you (please be patient)
Can't call method "http" on unblessed reference at /usr/share/perl5/CPAN/FirstTime.pm line 1866.
Nagios XI 5.5.2
OS – RHEL 7
Gearamand server - gearmand 0.33
Nrpe -- NRPE v3.2.1

Please let me know if you need any other details.
You do not have the required permissions to view the files attached to this post.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Prerequisites for check_oracle_health plugins

Post by vAJ »

Looks like you don't have CPAN installed on this GM poller?

Just run:

Code: Select all

cpan
and see if it returns. Otherwise:

Code: Select all

yum install perl-CPAN
as root
Andrew J. - Do you even grok?
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: Prerequisites for check_oracle_health plugins

Post by rtsupport »

CPAN is already installed..

Code: Select all

rpm -qa | grep -i cpan
perl-CPAN-1.9800-292.el7.noarch
perl-CPAN-Meta-2.120921-5.el7.noarch
perl-Parse-CPAN-Meta-1.4404-5.el7.noarch
perl-CPANPLUS-Dist-Build-0.70-3.el7.noarch
perl-CPAN-Meta-YAML-0.008-14.el7.noarch
perl-CPANPLUS-0.91.38-4.el7.noarch
perl-CPAN-Meta-Requirements-2.122-7.el7.noarch
yum install perl-CPAN

Code: Select all

yum install perl-CPAN
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
RHEL7-Server-WDC                                                                                         | 1.1 kB  00:00:00
epel/x86_64/metalink                                                                                     |  16 kB  00:00:00
epel                                                                                                     | 3.2 kB  00:00:00
(1/2): epel/x86_64/updateinfo                                                                            | 939 kB  00:00:00
(2/2): epel/x86_64/primary                                                                               | 3.6 MB  00:00:04
epel                                                                                                                12659/12659
Package perl-CPAN-1.9800-292.el7.noarch already installed and latest version
Nothing to do
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Prerequisites for check_oracle_health plugins

Post by vAJ »

Are you executing the Nagios install script as root?
Andrew J. - Do you even grok?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Prerequisites for check_oracle_health plugins

Post by ssax »

In addition to what vAJ posted about running it as root, do you have a proxy/web gateway that your internet goes through?
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: Prerequisites for check_oracle_health plugins

Post by rtsupport »

I am not installing Nagios it is already installed, but yes command i am executing to install are done by root user
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: Prerequisites for check_oracle_health plugins

Post by rtsupport »

ssax wrote:In addition to what vAJ posted about running it as root, do you have a proxy/web gateway that your internet goes through?
Yes, we are running in proxy environment.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Prerequisites for check_oracle_health plugins

Post by lmiltchev »

You may need to reinstall cpan as described here:

https://access.redhat.com/solutions/3049991

Have you set up cpan to work with your proxy? I haven't done this myself but found this article on the topic:

http://abhijit.name/setting_cpan_for_proxy.html

Users, who have experience with cpan + proxies, are welcome to chime in.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: Prerequisites for check_oracle_health plugins

Post by rtsupport »

Sorry for delay in response, CPAN is corrected and now we are getting below error, please advise.

we are executing script using root user let us now if user account to be used and required environment set for user

Code: Select all

-bash-4.2$ pwd
/u01/working_dir/oracle_client

-bash-4.2$ ls -ltr
total 54860
drwxr-xr-x 5 197609 197121     4096 Jun 25 14:42 check_oracle_health-3.1.2.2
-rw-r--r-- 1 nagios nagios   174167 Aug 13 16:08 check_oracle_health-3.1.2.2.tar.gz
-rw-r--r-- 1 nagios nagios 54650380 Aug 24 06:27 oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm
-rw-r--r-- 1 nagios nagios   717272 Aug 24 06:30 oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.x86_64.rpm
-rw-r--r-- 1 nagios nagios   614516 Aug 24 06:31 oracle-instantclient18.3-devel-18.3.0.0.0-1.x86_64.rpm
-rwxr-xr-x 1 nagios nagios     2215 Sep  3 17:06 oracleinstall.sh
-bash-4.2$



-bash-4.2$ sudo sh oracleinstall.sh
[sudo] password for c5065232:
#######################################
#                                     #
# This is the installer script        #
# for installing Oracle monitoring    #
# libraries.                          #
#                                     #
# Before you continue, be sure that   #
# the oracle-basic, sqlplus and devel #
# are in the same directory as this   #
# installer script.                   #
#                                     #
#######################################
RPM installation was successful!
CPAN may ask you questions. Choose 'No' if it asks if you want to
do a manual install, unless you have special internet settings.
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 04 Sep 2018 19:54:12 GMT
DBI is up to date (1.641).
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 04 Sep 2018 19:54:12 GMT
Running install for module 'DBD::Oracle'
Running make for P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz
Checksum for /root/.cpan/sources/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz ok

  CPAN.pm: Building P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz

Multiple copies of Driver.xst found in: /usr/local/lib64/perl5/auto/DBI/ /usr/lib64/perl5/vendor_perl/auto/DBI/ at Makefile.PL line 39.
Using DBI 1.641 (for perl 5.016003 on x86_64-linux-thread-multi) installed in /usr/local/lib64/perl5/auto/DBI/

Configuring DBD::Oracle for perl 5.016003 on linux (x86_64-linux-thread-multi)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#2.6
Using Oracle in /usr/lib/oracle/18.3/client64
DEFINE _SQLPLUS_RELEASE = "1803000000" (CHAR)
Oracle version 18.3.0.0 (18.3)

        Unable to locate an oracle.mk or other suitable *.mk
        file in your Oracle installation.  (I looked in
        /usr/lib/oracle/18.3/client64/rdbms/demo/demo_xe.mk /usr/lib/oracle/18.3/client64/rdbms/lib/oracle.mk /usr/lib/oracle/18.3/client64/rdbms/demo/oracle.mk /usr/lib/oracle/18.3/client64/rdbms/demo/demo_rdbms.mk /usr/lib/oracle/18.3/client64/rdbms/demo/demo_rdbms64.mk /usr/lib/oracle/18.3/client64/rdbms/lib/ins_rdbms.mk /usr/share/oracle/18.3/client64/demo.mk under /usr/lib/oracle/18.3/client64)

        The oracle.mk (or demo_rdbms.mk) file is part of the Oracle
        RDBMS product.  You need to build DBD::Oracle on a
        system which has one of these Oracle components installed.
        (Other *.mk files such as the env_*.mk files will not work.)
        Alternatively you can use Oracle Instant Client.

        In the unlikely event that a suitable *.mk file is installed
        somewhere non-standard you can specify where it is using the -m option:
                perl Makefile.PL -m /path/to/your.mk

        See the appropriate README file for your OS for more information and some alternatives.

     at Makefile.PL line 1187.
Warning: No success on command[/usr/bin/perl Makefile.PL]
  PYTHIAN/DBD-Oracle-1.74.tar.gz
  /usr/bin/perl Makefile.PL -- NOT OK
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
-bash-4.2$
Looking for CPAN mirrors near you (please be patient)
Can't call method "http" on unblessed reference at /usr/share/perl5/CPAN/FirstTime.pm line 1866.
[nagios@u*** oracle_client]$ vi /usr/share/perl5/CPAN/FirstTime.pm
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: Prerequisites for check_oracle_health plugins

Post by rtsupport »

I believe i did it, i copied "demo.mk" from working worker server to this server "/usr/share/oracle/18.3/client64" and after that when i run install script seems its done now. Could you please check and confirm. (have attached output)

Also as per document i have modified all three oracle commands with variable path.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

and after that when executing the plugin i am getting below error which is known as per doc but still unable to understand what else i have to make changes to make it run.

Code: Select all

CRITICAL - cannot connect to usa030****:15**/T1***. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
 at (eval 14) line 3.
Compilation failed in require at (eval 14) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at ./check_oracle_health line 4755.
You do not have the required permissions to view the files attached to this post.
Locked