Sending Notifications of Failed Health Checks in Oracle Cloud Infrastructure


Notifications service is a broadcast message delivery based in publish-subscribe mechanism. Health Checks service provides users with high frequency external monitoring to determine the availability and performance of any publicly facing service, including hosted websites, API endpoints, or externally facing load balancers.

One: Create a Health Check

Click the HealthChecks menu option located in the Monitoring section of the OCI dashboard left menu and then in the [Create Health Check] button:

Write down the target such as http://www.oracle.com, select one or more vantage points from the list, protocol, port, path, etc…

Two: Consult the Health Check History

Three: Create Notification Stuff

Subscription to email channel
Currently you can create 3 types of protocols

Four: Create the job in DevCS

For the purpose of executing periodically a query searching for failed checks we are utilising Developer Cloud Service the same way explained in this post. In this particular use case we are using the script located in github here.

We must create 3 parameters named healthcheck, notificationtopic and count the same way like explained in the mentioned post, each one with the value as follows:

healthcheck: is the OCID of the healthcheck

How to get the healthcheck od

notificationtopic: is the OCID of the notification

count: the number equal or greater the result of the division between the job frequency and the healthcheck frequency. For instance, if the healthcheck frequency is 5 minutes and the job frequency is gonna be 15 minutes, count should be >= 3 (15/5)

Example of parameters set

Then in the shell script step put the following:

git clone https://github.com/javiermugueta/oci-healthcheck-notifications
cd oci-healthcheck-notifications
chmod 700 ohcm.sh
./ohcm.sh ${healthcheck} ${notificationtopic} ${count}

Five: Plan the job and see what happens

As explained in the mentioned post, plan the execution of the job with the frequency you decided and used for the formula in step four.

Job executed every 15 minutes
Log of the job in DevCS
Email notification

That’s all, hope it helps! 🙂

3 Comments

  1. David salmeron

    Hi Javier, there is a way to configure event notifications to include the user / userID of the user who is performing the activity, for example: the stop / start of an instance, when this activity happens within the notification email include the user that stopped / started the instance?
    I hope I have not confused you with my question.

    Greetings

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.