Tuesday, January 14, 2020

Monitor Compute instance in Oracle Cloud using metrics

The purpose of this particular blog is to demonstrate on how to setup and receive notifications via email when the compute instance goes down.


My running compute instance:-




And we have metrics associated with it also such as memory utilization, CPU utilization etc.




I have the tenancy admin rights enabled for this. If not, then we need to assign the below policies to the group which belongs to the user.

Allow group UserGroup1 to read metrics in tenancy
Allow group UserGroup1 to manage alarms in tenancy
Allow group UserGroup1 to manage ons-topics in tenancy
Allow group UserGroup1 to manage ons-subscriptions in tenancy


Once it is done, create the notification subscription





In the notifications page, create a topic










                     Now we will create a subscription using the topic which was created earlier.


                 



           


          


At this stage, we should be getting en email to confirm the subscription. Once the subscription is done, the color will change to green

               


Next, we will be creating an alarm definition













This will now trigger an email when the metrics will not be available for more than 2 minutes. At this moment, we will stop the compute instance.

After we waited for more than 2 minutes, we should see the alarm status as below





And the email snippet



Once the instance comes up and running, the alarm status will be in Ok status again.




Hope this will help someone. Happy learning







No comments:

Post a Comment