Getting started with Amazon CloudWatch
Notifying gfg website management team when the instance on which gfg website is hosted stops Whenever the CPU utilization of instance (on which w3wiki website is hosted ) goes above 80%, cloudwatch event is triggered. This cloudwatch event then activates the SNS topic which sends the alert email to the attached gfg subscribers.
Create an SNS Topic
Step 1: Let us assume that you have already launched an instance with the name tag ‘instance’.
Step 2: Go to SNS topic dashboard and click on create a topic
Step 3: You will be directed to this dashboard. Now specify the name and display name.
Step 4: Scroll down and click on create the topic.
Step 5: The SNS topic is created successfully.
Add Subscribers
Step 1: Go to the SNS topic dashboard and click on gfgtopic link.
Step 2: Under the subscriptions section, Click on Create subscription.
Step 3: Select Email as protocol and specify the email address of subscribers in Endpoint. Click on create the subscription. Now Go to the mailbox of the specified email id and click on Subscription confirmed.
Craft the CloudWatch Alarm
Step 1: Go to the cloudwatch dashboard on the AWS management console. Click on Metrics in the left pane.
Step 2: In All metrics section click on EC2
Step 3: Click on Per-instance metrics
Step 4: Select the instance you launched
Step 5: Go to Graphed metrics, click on the bell icon
Step 6: This dashboard shows the components of Amazon Cloudwatch such as Namespace, Metric Name, Statistics, etc
Set the Threshold
Step 1: Select the greater threshold. Also, specify the amount( i.e 80 ) of the threshold value. Click on Next.
Connect the Dots
Step 1: Click on Select an existing SNS topic, also mention the name of the SNS topic you created now.
Step 2: Specify the name of alarm and description which is completely optional. Click on Next and then click on Create alarm.
Monitor Your Instances Using CloudWatch
Step 3: The alarm is successfully created.
Step 4: You can see the graph which notifies whenever CPU utilization goes above 80%.
Introduction to Amazon Cloudwatch
Amazon CloudWatch is a service used for monitoring and observing resources in real-time, built for DevOps engineers, developers, site reliability engineers (SREs), and IT managers. CloudWatch provides users with data and actionable insights to monitor their respective applications, stimulate system-wide performance changes, and optimize resource utilization. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, providing its users with an aggregated view of AWS resources, applications, and services that run on AWS. The CloudWatch can also be used to detect anomalous behavior in the environments, set warnings and alarms, visualize logs and metrics side by side, take automated actions, and troubleshoot issues.
Contact Us