Overview

This way partially uses the script method but this time, instead of receiving spam A LOT. I will integrate the script with nagios so I can be notified ONLY when there is a problem.

Nagios Basics

You can use ANY script with nagios as soon as it provides the correct exit status. Nagios script should exit with:

0 - If all is OK

1 - If it is Warning

2 - If it is Critical

3 - If it is unknown

Knowing that, I have modified the previous script to exit accordingly:

Script to be integrated with Nagios

The following scripts, exports the ORACLE_HOME, ORACLE_SID (as long as it is the last one) and the Golden Gate Home location (as long as it is somewhere under /u01/app). The scripts also exits appropriately as listed above.

Now to make that script works we have to make coupel things:

Configure The monitoring

We have to configure two thigns here:

Nagios on Client Side

Nagios on Server Side

The client configuration will involve re-configuring the NRPE cfg and sudoers (as we need nagios to execute the script as oracle owner) The Server Configuration Will include adding this config on the nagios server.

Configure Nagios Client

Nagios usually comes with plugin called NRPE. Locate where is the nrpe.cfg and edit it as follows by appending this line at the end:

Edit NRPE cfg

It is import the script to be executed with Oracle user as the golden gate doesn't have a client way of connecting to the console.

Once that is done, we have to update the sudoers as well. I know there is way more secure way, but I have done as follows:

Update Sudoers

That will allow the nagios to execute any command as any user. I know quite unsecure, feel free to change it with ALL=(oracle)

Once this is done, it is ready to add that in the nagios itself :)

Configure the Nagios Server

Once this is all done, we are ready to add this feature to our server:

Go to:

Configure → Core Config

Services

Add New → Fill the fields as follows:

Common Settings

Config Name: check_gg_oracle

Description: Checking Oracle Golden Gate (Or whatever you want)

Check Command: check_nrpe

$ARG$: check_gg_oracle

Mangage Hosts: Add the needed hosts which you want to monitor.

Check Settings and the rest of tabs:

As desired according your needs

After all this is done, you should be able to see the monitoring status for that service in your dashboard.