How to Create a Status Check Alarm for an AWS EC2 Instance
AWS EC2 provides status checks that detect the problems with the underlying EC2 system used by the individual system. There are two types of checks performed every five minutes, which return a pass or a fail status. The two checks are:
- System Reachability Check, which confirms that AWS is able to get the network packets to the user’s instance.
- Instance Status Check, which detects a problem within the EC2 instance.
If both the checks are passed, the overall status of the instance will be OK. If one of the checks fails, the overall status of the instance will be impaired. The following guide demonstrates how to set the status check alerts for the instance.
The sample probable reasons for the failure of status checks include:
A) System Reachabilty Checks:
- Loss of network connectivity
- Loss of system power
- Software issues on the physical host
- Hardware issues on the physical host
B) Instance Status Checks:
- Misconfigured networking or startup configuration
- Exhausted memory
- Corrupted file system
- Incompatible kernel
[Newvem helps you to discover how your cloud resources are utilized, learn utilization changes on an hourly basis, look back into historical usage patterns and determine how your consumption is trending. Learn more about Newvem's features]
1. Enter your AWS console and select the EC2 service. From the EC2 dashboard, click on the Running Instances or the Instance link.
2. Select the running instance. The status checks displays 2/2, which shows that the instance has passed both the status checks. Click on the “Status Checks” tab.
3. The “Status Checks” tab shows that the instance has passed both the System and the Instance Reachability checks. Click on “Create Status Check Alarm”.
4. The Cloudwatch alarm page will open the alert configuration page. The above mentioned page asks for information, such as the email address, status check period, etc.
5. Provide the notification name (SNS Topic Name), the email where the notifications will be sent, the status failure check (either only Instance reachability or only system reachability or both), the period for which the checks will be performed, and the name of the alarm. Click on the “Create Alarm” button.
6. The alarm will now be created. Click on the “Close” button to close the confirmation page or click on the name of the alarm to go to the Cloudwatch alarm page.
7. The Cloudwatch alarm shows the alarm name, the action, the current state as well as the other details of the alarm.
8. AWS will send the acknowledgement mail on the email address specified in step#5. Confirm the subscription through the confirm subscription page.
9. To run the above mentioned steps through the command line interface, first setup AWS CloudWatch CLI to launch an instance with the command line option, as explained here.
10. Run the command:
mon-put-metric-alarm --alarm-name InstanceStatusScheckFailed --alarm-description "Alarm sends Email when Instance Status Check fails" --metric-name StatusCheckFailed --namespace AWS/EC2 --statistic Maximum --period 300 --threshold 2 --comparison-operator GreaterThanThreshold --dimensions "InstanceId=i-f818c8ca" --evaluation-periods 3 --alarm-actions arn:aws:sns:us-west-2:xxxxxxxxxxxx:StatusAlert --unit Count --region us-west-2
The above step configures the alarm for the status check.
11. The actual output is shown below, whereby the user changed the instance type from medium to micro.
[Newvem analytics tracks your AWS cloud utilization:
- Hourly Utilization Pattern Analysis
- Reserved Instances Decision Tool
- Resource Resizing Opportunities
Get Started with Newvem For Free or Learn more about Newvem's features]
Keywords: Amazon web services, Amazon AWS console, Amazon AWS instances, EC2 Service, Amazon cloud computing, System Reachability Check, Instance Status Check, Cloud Monitoring, CloudWatch, CLI tools, CloudWatch Alarm
You must be logged in to post a comment.