How to monitor an Oracle database using an Ubuntu 16.04 ServiceNav Box ?

The Ubuntu 16.04 SNB contains clients for Oracle 11.2 and  12.2. It is therefore necessary, depending on the Oracle version to be monitored, to use the right client.

To do this we need to modify the nagios environment to ensure the right client is used.

Modifying the Nagios environment

Depending on the Oracle version to be monitored, modify the file /home/nagios/.bashrc commenting out the lines reflecting the client version NOT to be used:

Edit the file /home/nagios/.bashrc and comment out the line of the client not to be used (for example, when using the 12.2 client):

# BEGIN ANSIBLE MANAGED BLOCK
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export PATH=$PATH:/usr/lib/oracle/12.2/client64/bin
export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
# END ANSIBLE MANAGED BLOCKexport ORACLE_HOME=/usr/lib/oracle/11.2/client64
#export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/oracle/11.2/client64/bin
#export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib

 

Repeat the same operation on the file /etc/sysconfig/nagios:

Edit the file  /etc/sysconfig/nagios and comment out the line of the client not to be used (for example, when using the 12.2 client):

# BEGIN ANSIBLE MANAGED BLOCK
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export PATH=$PATH:/usr/lib/oracle/12.2/client64/bin
export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
# END ANSIBLE MANAGED BLOCK
#export ORACLE_HOME=/usr/lib/oracle/11.2/client64
#export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/oracle/11.2/client64/bin
#export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib

Restart nagios: /etc/init.d/nagios restart

Once these modifications have been made, refer to the following procedure: Monitoring Oracle Databases

UK ServiceNav Product Development Manager; my priority is to be needful of the particular requirements of all ‘English-speaking’ markets where ServiceNav is sold. I have over 20 years experience of the IT monitoring field - covering a wide variety of products and technologies.