Moneycontrol Brokerage Recos

Saturday, September 28, 2019

Oracle Cloud Infrastructure - Resources Monitoring | Email Notifications



In this article, we would see how to monitor the all Oracle Cloud Infrastructure(OCI) resources at one place and would see how to define alarm notifications for a kind of metric and metrics dimension.

You won't have access to the autonomous database compute nodes in the cloud but you have the luxury to monitor OS level statistics and can monitor the health, capacity, and performance of your Oracle Cloud Infrastructure resources when needed using queries or on a passive basis using alarms. Queries and alarms rely on metrics emitted by your resource to the Monitoring service.


An Administrator has super privilege to manage and monitoring all Oracle Cloud Infrastructure resources it has in its Identity domain/Tenancy.

If you want a different user to only monitor all the OCI resources then a new user can be created and assigned appropriate IAM policies to monitor the resources.

Monitoring is possible only for resources that is enabled for monitoring or which emits the metrics. Queries and Alarms used these emitted metrics for its notification rules and methods. The Monitoring service works with the Notifications service to notify you when metrics breach.

Lets' get started:

Login to your Oracle Cloud Infrastructure Service Console and click on the navigation menu and click on Monitoring > Service Metrics - to open the "Monitoring" page for all OCI resources.






"Service Metrics" page opens, The Service Metrics page displays the default charts for metrics in the first accessible Compartment and Metric Namespace. Very small or large values are indicated by International System of Units (SI units), such as M for mega (10 to the sixth power).

You can select any COMPARTMENT and appropriate METRICS NAMESPACE and adjust the "START TIME" and "END TIME" to narrow down the metrics graphic visualization for the metric namespaces and review its trend to predict the underline hardware/resource health.



For any Metrics type, you can click on its "Options" and Copy Chart URL - a direct URL to view this metrics graph in web browser.




Select any metrics namespace you want to see the metrics trend.


















Metrics Explorer:

Write and edit queries in Monitoring Query Language (MQL), using metrics from either your application or an Oracle Cloud Infrastructure service.

By default, Metrics Explorer has no graph, you can write MQL query or construct one automatically using the selection criteria.





Below I am adding an MQL(Monitoring Query Language) Query 1:

COMPARTMENT : comp01
Metrics Namespace : oci_autonomous_database
Metric name : cpuUtilization
Interval : 1m - 1 minute
Statistic : Mean
Metrics Dimension : AutonomousDBType
Dimension Value : ATP

and Click on Update Chart >




Once you clicked on the "Update Chart" above, it populates the "Metrics Explorer" chart metrics with graph for for the autonomous database.






Similarly, we can add another MQL query for the OCI compute agent for the metric name = DiskBytesWritten as below.





Alarm Status:


If you want to "Create Alarm" for any query, you can click on the "Create Alarm" button instead of "Update Chart" from the "Metric Explorer" or click on the "Alarm Definition" at left side and create alarm page opens up for some details to be filled up before finishing it.


In "Define Alarm" section, Provide relevant "Alarm Name" and its Severity and Alarm description. Optionally you can give resource tags as well.




In the "Metric Description" section, Select the appropriate compartment, metric namespace, metric name to you to be alerted for, dimension name and its value. Most important, put the right trigger rule(it is the threshold value for the metric name you are enabling the alarming notification). In my case, I am creating this alarm for the CPU utilization, so I give trigger value 1 for the demonstration.






In the "Notification" section, select the right TOPIC in which you have defined the email subscription and click on "Save alarm".




If you don't have an Alarm Topic created then you can click on the "Create a Topic" and provide email details- Alarm Topic an email subscription where alarm notifications would be sent out. In my case, I am creating an alarm for the CPU utilization for my autonomous database dimensions. Provide "NOTIFICATION FREQUENCY" to re-evaluate the alarm status to make sure if that is still above it defined threshold or cleared, If alarm remains above its defined threshold then Alarm would fire and email alert at the subscribed email. Make sure alarm is checked as enabled in the end and click on "Save Alarm".


You should check the "REPEAT NOTIFICATION" option to provide the frequency to repeat the alarm notification if the event is not resolved/cleared.



Once you save, alarm gets create and available for the monitoring.



A while ago, you subscribed to an alarm topic that you created, you would receive an email confirmation once you subscribe to confirm for the destination email where alerts would be dispatched.

You get an email as below.






Alarm Definition:

Once you create the alarm, then you can go back to Alarm Definition to see the list of alarms you have created for the different OCI resource/dimensions monitoring.



To view the MQL for an alarm definition, you open an alarm and go to its Query section and expand it.



CpuUtilization[1m]{AutonomousDBType = "ATP"}.mean()



OCID1.AUTONOMOUSDATABASE.OC1.AP-MUMBAI-1.ABRG6LJRBEWFTBLJTRMG74GA6BJ3CBHXH6SQB3ESXDBYO2C3M2OKBGJ3OFUA



You can click on the Alarm Name to view its alarming history.






Once alert criteria meets then it fires and you get an email alert like below. If you don't want to receive any further email notification or a user wants to exclude himself from the email alert subscription then he/she can click on the "unsubscribe" link in the email alert body to stop receiving the alerts further.





Similarly, you define the alarming notifications for all metrics available for "METRIC NAMESPACE" in a compartment.

Hope it helps, thanks for reading, please subscribe to this blog to stay updated with latest news on Oracle Cloud Infrastructure and Oracle Autonomous Database Cloud Services and new articles.

Twitter : https://twitter.com/rajsoft8899
Linkedin : https://www.linkedin.com/in/raj-kumar-kushwaha-5a289219/



No comments:

Post a Comment