Oracle Installation on Nagios server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Oracle Installation on Nagios server

Post by raamardhani7 »

tgriep wrote:Try this to see if this will resolve the issues.

Run this on the XI server as root to install some required packages.

Code: Select all

yum install -y glibc-static
yum install -y glibc-utils
Next, edit the oracleinstall.sh script and change this line from

Code: Select all

yum -y install glibc\* perl-YAML
to

Code: Select all

yum -y install perl-YAML
Save the file and run the script again.
Let us know if this works or not.


Hi Tom,

I've edited the script and tried installing and below is the error I am facing with now...

Code: Select all

[root@lussvpnagiosxi00 tmp]# ./oracleinstall.sh
#######################################
#                                     #
# 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.                   #
#                                     #
#######################################
Loaded plugins: changelog, product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
epel/metalink                                                                                                                                    |  13 kB     00:00
nagios-base                                                                                                                                      | 1.5 kB     00:00
nagiosxi-deps                                                                                                                                    | 1.5 kB     00:00
rhel-x86_64-server-6                                                                                                                             | 1.5 kB     00:00
rhel-x86_64-server-optional-6                                                                                                                    | 1.5 kB     00:00
rhn-tools-rhel-x86_64-server-6                                                                                                                   | 1.3 kB     00:00
rpmforge                                                                                                                                         | 1.9 kB     00:00
Package perl-YAML-0.70-4.el6.noarch already installed and latest version
Nothing to do
Loaded plugins: changelog, product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Local Package Process
Cannot open: oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm. Skipping.
Cannot open: oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm. Skipping.
Cannot open: oracle-instantclient11.2-devel-11.2.0.2.0.x86_64.rpm. Skipping.
Nothing to do
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.
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters...



The following questions are intended to help you with the
configuration. The CPAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of CPAN files.
This may be a site-wide or a personal directory.



First of all, I'd like to create this directory. Where?

 <cpan_home>
CPAN build and cache directory? [/root/.cpan]

Code: Select all

cat oracleinstall.sh
#!/bin/sh

set -e
set -u

PLUGIN_URL="http://assets.nagios.com/downloads/nagiosxi/packages/check_oracle_health-1.7.3.tar.gz"
PLUGIN_VER=$(echo "$PLUGIN_URL" | sed 's/.*check_oracle_health-\(.*\).tar.gz/\1/')

cat <<- EOF
        #######################################
        #                                     #
        # 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.                   #
        #                                     #
        #######################################
EOF

### DO YUM

yum -y install perl-YAML

# DO RPM INSTALLS

yum -y --nogpgcheck localinstall          \
        oracle-instantclient*basic*.rpm   \
        oracle-instantclient*sqlplus*.rpm \
        oracle-instantclient*devel*.rpm

echo "RPM installation was successful!"

### SETTING ENVIRONMENT VARIABLES

if arch | grep 64 >/dev/null; then
        client="client64"
else
        client="client"
fi

version=$(echo oracle-instantclient*basic*.rpm | sed 's/.*instantclient\([0-9.]*\).*/\1/')

export ORACLE_HOME="/usr/lib/oracle/$version/$client"
export LD_LIBRARY_PATH="$ORACLE_HOME/lib"

### BEGIN CPAN INSTALL

echo "CPAN may ask you questions. Choose 'No' if it asks if you want to"
echo "do a manual install, unless you have special internet settings."

cpan -i DBI
cpan -i DBD::Oracle

# BEGIN SOURCE INSTALL :(

echo "Beginning source install..."
wget "$PLUGIN_URL"
tar xvf check_oracle_health-$PLUGIN_VER.tar.gz

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

# DO MKDIR

mkdir /var/tmp/check_oracle_health
chown -R nagios /var/tmp/check_oracle_health

echo "ORACLE_HOME=/usr/lib/oracle/$version/$client"
echo "LD_LIBRARY_PATH=/usr/lib/oracle/$version/$client/lib"

All the files are in /tmp location.
From which should I need to install and to which location the files goes to??
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Oracle Installation on Nagios server

Post by Box293 »

Try running this at the command line:

Code: Select all

cpan
You'll be prompted with a bunch of questions, just press enter to accept all the defaults. You may need to define a mirror at some point.
Finally you'll get to a cpan> prompt.
Type quit

Now try the ./oracleinstall.sh script.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Oracle Installation on Nagios server

Post by raamardhani7 »

Box293 wrote:Try running this at the command line:

Code: Select all

cpan
You'll be prompted with a bunch of questions, just press enter to accept all the defaults. You may need to define a mirror at some point.
Finally you'll get to a cpan> prompt.
Type quit

Now try the ./oracleinstall.sh script.

Code: Select all

cpan
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters...



The following questions are intended to help you with the
configuration. The CPAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of CPAN files.
This may be a site-wide or a personal directory.



I see you already have a  directory
    /root/.cpan
Shall we use it as the general CPAN build and cache directory?

 <cpan_home>
CPAN build and cache directory? [/root/.cpan]

Unless you are accessing the CPAN on your filesystem via a file: URL,
CPAN.pm needs to keep the source files it downloads somewhere. Please
supply a directory where the downloaded files are to be kept.

 <keep_source_where>
Download target directory? [/root/.cpan/sources]

 <build_dir>
Directory where the build process takes place? [/root/.cpan/build]

Normally CPAN.pm keeps config variables in memory and changes need to
be saved in a separate 'o conf commit' command to make them permanent
between sessions. If you set the 'auto_commit' option to true, changes
to a config variable are always automatically committed to disk.

 <auto_commit>
Always commit changes to config variables to disk? [no]

CPAN.pm can limit the size of the disk area for keeping the build
directories with all the intermediate files.

 <build_cache>
Cache size for build directory (in MB)? [100]

The CPAN indexes are usually rebuilt once or twice per hour, but the
typical CPAN mirror mirrors only once or twice per day. Depending on
the quality of your mirror and your desire to be on the bleeding edge,
you may want to set the following value to more or less than one day
(which is the default). It determines after how many days CPAN.pm
downloads new indexes.

 <index_expire>
Let the index expire after how many days? [1]

By default, each time the CPAN module is started, cache scanning is
performed to keep the cache size in sync. To prevent this, answer
'never'.

 <scan_cache>
Perform cache scanning (atstart or never)? [atstart]

To considerably speed up the initial CPAN shell startup, it is
possible to use Storable to create a cache of metadata. If Storable is
not available, the normal index mechanism will be used.

Note: this mechanism is not used when use_sqlite is on and SQLLite is
running.

 <cache_metadata>
Cache metadata (yes/no)? [yes]

The CPAN module can detect when a module which you are trying to build
depends on prerequisites. If this happens, it can build the
prerequisites for you automatically ('follow'), ask you for
confirmation ('ask'), or just ignore them ('ignore'). Please set your
policy to one of the three values.

 <prerequisites_policy>
Policy on building prerequisites (follow, ask or ignore)? [ask]

Every Makefile.PL is run by perl in a separate process. Likewise we
run 'make' and 'make install' in separate processes. If you have
any parameters (e.g. PREFIX, UNINST or the like) you want to
pass to the calls, please specify them here.

If you don't understand this question, just press ENTER.

Typical frequently used settings:

    PREFIX=~/perl    # non-root users (please see manual for more hints)

 <makepl_arg>
Parameters for the 'perl Makefile.PL' command? [INSTALLDIRS=site]

Parameters for the 'make' command? Typical frequently used setting:

    -j3              # dual processor system (on GNU make)

 <make_arg>
Your choice: []

Parameters for the 'make install' command?
Typical frequently used setting:

    UNINST=1         # to always uninstall potentially conflicting files

 <make_install_arg>
Your choice: []

A Build.PL is run by perl in a separate process. Likewise we run
'./Build' and './Build install' in separate processes. If you have any
parameters you want to pass to the calls, please specify them here.

Typical frequently used settings:

    --install_base /home/xxx             # different installation directory

 <mbuildpl_arg>
Parameters for the 'perl Build.PL' command? [--installdirs site]

Parameters for the './Build' command? Setting might be:

    --extra_linker_flags -L/usr/foo/lib  # non-standard library location

 <mbuild_arg>
Your choice: []

Do you want to use a different command for './Build install'? Sudo
users will probably prefer:

    su root -c ./Build
 or
    sudo ./Build
 or
    /path1/to/sudo -u admin_account ./Build

 <mbuild_install_build_command>
or some such. Your choice: [./Build]

Parameters for the './Build install' command? Typical frequently used
setting:

    --uninst 1                           # uninstall conflicting files

 <mbuild_install_arg>
Your choice: []



If you're accessing the net via proxies, you can specify them in the
CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.

 <ftp_proxy>
Your ftp_proxy? []

 <http_proxy>
Your http_proxy? []

 <no_proxy>
Your no_proxy? []

CPAN needs access to at least one CPAN mirror.

As you did not allow me to connect to the internet you need to supply
a valid CPAN URL now.

Please enter the URL of your CPAN mirror
CPAN needs access to at least one CPAN mirror.

As you did not allow me to connect to the internet you need to supply
a valid CPAN URL now.

Please enter the URL of your CPAN mirror
CPAN needs access to at least one CPAN mirror.

As you did not allow me to connect to the internet you need to supply
a valid CPAN URL now.
What mirror I should give, I am not sure on this, please help.. thanks.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Oracle Installation on Nagios server

Post by Box293 »

This site should provide a mirror close to you:

http://mirrors.cpan.org/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Oracle Installation on Nagios server

Post by raamardhani7 »

Box293 wrote:This site should provide a mirror close to you:

http://mirrors.cpan.org/
looks like this is worked.

Code: Select all

chmod +x check_oracle_health
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
Making all in t
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3/t'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3/t'
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3'
Making install in plugins-scripts
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
make[2]: Entering directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
test -z "/usr/local/nagios/libexec" || mkdir -p -- "/usr/local/nagios/libexec"
 /usr/bin/install -c 'check_oracle_health' '/usr/local/nagios/libexec/check_oracle_health'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
Making install in t
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3/t'
make[2]: Entering directory `/tmp/check_oracle_health-1.7.3/t'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/check_oracle_health-1.7.3/t'
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3/t'
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3'
make[2]: Entering directory `/tmp/check_oracle_health-1.7.3'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/check_oracle_health-1.7.3'
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3'
ORACLE_HOME=/usr/lib/oracle/12.1/client64
LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib

Code: Select all

[root@lussvpnagiosxi00 tmp]# cd /usr/lib/oracle/
-bash: cd: /usr/lib/oracle/: No such file or directory

[root@lussvpnagiosxi00 tmp]# cd /usr/lib
[root@lussvpnagiosxi00 lib]# ls
anaconda-runtime  cups   java        java-1.4.1  java-1.6.0  java-ext     jvm-exports   locale  python2.4  scons             sendmail.sendmail
bonobo            games  java-1.3.1  java-1.4.2  java-1.7.0  jvm          jvm-private   lsb     python2.6  sendmail          vmware-tools
ConsoleKit        gcc    java-1.4.0  java-1.5.0  java-1.8.0  jvm-commmon  libstorix.so  mrtg2   rpm        sendmail.postfix  yum-plugins

Code: Select all

[root@lussvpnagiosxi00 tmp]# cd check_oracle_health-1.7.3
[root@lussvpnagiosxi00 check_oracle_health-1.7.3]# ls
acinclude.m4  AUTHORS         ChangeLog     config.log     config.sub  configure.in  COPYING  install-sh  Makefile.am  missing  plugins-scripts  t
aclocal.m4    autom4te.cache  config.guess  config.status  configure   contrib       INSTALL  Makefile    Makefile.in  NEWS     README           TODO
This folder is seen in /tmp. does this mean Oracle is installed?? Please advice. thanks..
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Oracle Installation on Nagios server

Post by lmiltchev »

Run the following commands and show the output:

Code: Select all

ll /usr/lib/oracle/12.1/client64
ll /usr/lib/oracle/12.1/client64/lib
/usr/local/nagios/libexec/check_oracle_health --version
perldoc DBD::Oracle
perldoc DBI
Be sure to check out our Knowledgebase for helpful articles and solutions!
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Oracle Installation on Nagios server

Post by raamardhani7 »

lmiltchev wrote:Run the following commands and show the output:

Code: Select all

ll /usr/lib/oracle/12.1/client64
ll /usr/lib/oracle/12.1/client64/lib
/usr/local/nagios/libexec/check_oracle_health --version
perldoc DBD::Oracle
perldoc DBI

Code: Select all

[root@lussvpnagiosxi00 ~]# ll /usr/lib/oracle/12.1/client64
ls: cannot access /usr/lib/oracle/12.1/client64: No such file or directory

[root@lussvpnagiosxi00 ~]# ll /usr/lib/oracle/12.1/client64/lib
ls: cannot access /usr/lib/oracle/12.1/client64/lib: No such file or directory

[root@lussvpnagiosxi00 ~]# /usr/local/nagios/libexec/check_oracle_health --version
check_oracle_health (1.7.3)

This nagios plugin comes with ABSOLUTELY NO WARRANTY. You may redistribute
copies of this plugin under the terms of the GNU General Public License.
[root@lussvpnagiosxi00 ~]# perldoc DBD::Oracle
No documentation found for "DBD::Oracle".

Code: Select all

[root@lussvpnagiosxi00 ~]# perldoc DBI

NAME
       DBI - Database independent interface for Perl

SYNOPSIS
         use DBI;

         @driver_names = DBI->available_drivers;
         %drivers      = DBI->installed_drivers;
         @data_sources = DBI->data_sources($driver_name, \%attr);

         $dbh = DBI->connect($data_source, $username, $auth, \%attr);

         $rv  = $dbh->do($statement);
         $rv  = $dbh->do($statement, \%attr);
         $rv  = $dbh->do($statement, \%attr, @bind_values);

         $ary_ref  = $dbh->selectall_arrayref($statement);
         $hash_ref = $dbh->selectall_hashref($statement, $key_field);

         $ary_ref  = $dbh->selectcol_arrayref($statement);
         $ary_ref  = $dbh->selectcol_arrayref($statement, \%attr);

         @row_ary  = $dbh->selectrow_array($statement);
         $ary_ref  = $dbh->selectrow_arrayref($statement);
         $hash_ref = $dbh->selectrow_hashref($statement);

         $sth = $dbh->prepare($statement);
         $sth = $dbh->prepare_cached($statement);

         $rc = $sth->bind_param($p_num, $bind_value);
         $rc = $sth->bind_param($p_num, $bind_value, $bind_type);
         $rc = $sth->bind_param($p_num, $bind_value, \%attr);

         $rv = $sth->execute;
         $rv = $sth->execute(@bind_values);
         $rv = $sth->execute_array(\%attr, ...);

         $rc = $sth->bind_col($col_num, \$col_variable);
         $rc = $sth->bind_columns(@list_of_refs_to_vars_to_bind);

         @row_ary  = $sth->fetchrow_array;
         $ary_ref  = $sth->fetchrow_arrayref;
:
Still lot to go...
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Oracle Installation on Nagios server

Post by tgriep »

Can you run this command as root and post the output?

Code: Select all

ls -l /usr/share/oracle/12.1/client64/
If this folder doesn't have a file called demo.mk, then the Oracle 12.1 client isn't compatible with the DBD::Oracle perl module and you may need to remove the 12.1 clients and install the Oracle client version 11.2.
Be sure to check out our Knowledgebase for helpful articles and solutions!
raamardhani7
Posts: 459
Joined: Tue Jun 02, 2015 12:36 am

Re: Oracle Installation on Nagios server

Post by raamardhani7 »

tgriep wrote:Can you run this command as root and post the output?

Code: Select all

ls -l /usr/share/oracle/12.1/client64/
If this folder doesn't have a file called demo.mk, then the Oracle 12.1 client isn't compatible with the DBD::Oracle perl module and you may need to remove the 12.1 clients and install the Oracle client version 11.2.

Hi Tom,

Please find the output asked for..

Code: Select all

ls -l /usr/share/oracle/12.1/client64/
ls: cannot access /usr/share/oracle/12.1/client64/: No such file or directory
Could you please let me know how can I remove Oracle 12.1, And I am trying the same on another server too even that is having the same issue. Please advise..
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Oracle Installation on Nagios server

Post by tgriep »

It looks like they were not installed on your system but just in case, this should remove them if they were.

Code: Select all

yum remove oracle-instantclient*basic*
yum remove oracle-instantclient*sqlplus*
yum remove oracle-instantclient*devel*
After this, try and install the Oracle 11.2 clients and see if that resolves the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked