The Ubuntu 16.04 box embeds the Oracle 11.2 and 12.2 clients, so depending on the Oracle version to be supervised, use the right client.
In order to do this, the nagios environment will have to be modified so that the right client is called.
Modification of the nagios environment
Depending on the Oracle version to be supervised, modify the file /home/nagios/.bashrc by commenting on the lines that do not correspond to the Oracle version:
Edit the file /home/nagios/.bashrc and comment on the lines of the customer not to use (example to call client 12.2):
# 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:/bin:/usr/games:/usr/local/games:/usr/lib/oracle/11.2/client64/bin
#export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
Perform the same operation for the file /etc/sysconfig/nagios:
Edit the file /etc/sysconfig/nagios and comment on the lines of the customer not to use (example to call client 12.2):
# 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:/bin:/usr/games:/usr/local/games:/usr/lib/oracle/11.2/client64/bin
#export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
Restarting nagios: /etc/init.d/nagios restart
Once these changes have been made, refer to the following procedure: https://coservit.com/servicenav/fr/documentation/comment-superviser-une-base-de-donnees-oracle/