Opsview Knowledge Center

Database - Oracle RDBMS

An overview of the Oracle RDBMS Opspack for Opsview Monitor

Prerequisites

For legal reasons, we cannot distribute Oracle Instant Client with Opsview Monitor, so you will need to install this manually on your Opsview Monitor master and slaves. See the Platform Specific Steps for the steps required to install.

This has been tested against Oracle Database 11g Express Edition, however the monitoring should be uniform across all Oracle database platforms. This has been tested with Oracle Instant Client version 11.2.0.3.0 and DBD::Oracle 1.58

Download the Oracle Instant Client Files

Go to http://www.oracle.com/technetwork/database/features/instant-client. We recommend you select the latest versions of all packages. You will require an account with Oracle to access the packages.

For Debian, Ubuntu, CentOS, RHEL or SLES, download the Linux x86 or x86-64 based on the appropriate architecture of your operating system. Download the .rpm format file (not the .zip). You will need the following packages:

  • oracle-instantclient11.2-basic
  • oracle-instantclient11.2-sqlplus
  • oracle-instantclient11.2-devel

The rest of this section assumes that Oracle Instant Client is at version 11.2.0.3.0.

Debian and Ubuntu

Debian and Ubuntu need to install the alien package, in order to convert the Oracle Instant Client files from .rpm to .deb format. There is also a requirement for having libaio1. Run this as root:

apt-get install alien libaio1 fakeroot alien

Convert the packages into a .deb equivalent:

fakeroot alien --to-deb oracle-instantclient*.rpm

Now install these newly created packages:

sudo dpkg -i oracle-instantclient11.2-basic_11.2.0.3.0-2_i386.deb oracle-instantclient11.2-sqlplus_11.2.0.3.0-2_i386.deb oracle-instantclient11.2-devel_11.2.0.3.0-2_i386.deb

CentOS, RHEL

Install the packages with:

sudo rpm -i oracle-instantclient11.2-basic-11.2.0.3.0-1.i386.rpm sudo rpm -i oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.i386.rpm sudo rpm -i oracle-instantclient11.2-devel-11.2.0.3.0-1.i386.rpm

Environment Variables

We will need to set the bash variables of the nagios user to run the Oracle client. To do this, we must edit the '~nagios/.bashrc' file, and add the following lines to the bottom:
export ORACLE_HOME=/usr/lib/oracle/11.2/client # For 32 bit systems export ORACLE_HOME=/usr/lib/oracle/11.2/client64 # For 64 bit systems export PATH=$PATH:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

Log out and back in as the nagios user to confirm these variables are set correctly.

DBD::Oracle Perl Module

These steps document the installation of DBD::Oracle. This must be done manually as this will be compiled to the specific version of Oracle Instant Client that is installed. Be aware that if you upgrade Oracle Instant Client, you may have to rebuild the DBD::Oracle module.

Check if it is already installed:

perl -MDBD::Oracle -e 'print "Installed\n"'

If not, download the latest perl module from http://search.cpan.org/dist/DBD-Oracle/.

The rest of this section assumes the version is 1.58.

The compilation will require the gcc package.

Once we have downloaded the file to your Opsview Monitor system, you will need to extract, and then compile, as shown below:

su - nagios tar 'zxvf DBD-Oracle-1.58.tar.gz cd DBD-Oracle-1.58perl Makefile.PL make sudo make install

The Perl module will be installed into a system area so all Perl programs can access it. If there are problems compiling or installing the module this way, it might be easier to install it via the CPAN. As root, run:

cpan DBD::Oracle

Attributes

  • ORACREDENTIALS - arg1 is the username, arg2 is the password

Troubleshooting

Missing shared libraries

If you get errors like:

$ sqlplus sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

Then you have not set the environment variables for the user correctly, specifically the LD_LIBRARY_PATH variable.

Missing aio shared library

If you get errors like:

$ sqlplus sqlplus: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

Then you need to install a package that provides the aio (asynchronous I/O) library. See the instructions above based on your OS for the appropriate package.

Plugin cannot locate DBD/Oracle

If you get errors like:

CRITICAL - cannot connect to 192.168.12.126. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC

Then DBD::Oracle has not been installed correctly

Database - Oracle RDBMS

An overview of the Oracle RDBMS Opspack for Opsview Monitor