Tech Junkie Blog - Real World Tutorials, Happy Coding!: Iaas With AWS: Create A CloudWatch Alarm on Linux Instance

Monday, October 5, 2020

Iaas With AWS: Create A CloudWatch Alarm on Linux Instance

 CloudWatch is a service on AWS that is used to monitor services on AWS via metrics.  In addition to monitoring resources.  CloudWatch can be used to set alarms and perform some actions on the instance when a certain condition is met.  In this post we are going to set an alarm on our instance if CPU utilization gets to a certain threshold.  Which is a typical safeguard that most environments have, there are several actions that you can take when the threshold is met, in our case we are going to terminate the instance if the CPU utilization reaches 75%. 

The following shows you how to set a CloudWatch alarm on our Linux instance:

1. Click on "Monitoring" tab in the "Instances" page, then click on the "Create Alarm" button

2.  On the "Create Alarm" pop-up you want to check the "Take the action" checkbox and select the "Terminate this instance" radio button.  Leave the everything on default and type 75 on the percentage field.  Then click "Create Alarm".
3. A confirmation pop-up is presented, click "Close"
4. Now you see your alarm on the "Monitoring" tab and the instance will be terminated when the threshold in the alarm is reached

No comments:

Post a Comment

Search This Blog