How Can We Help?

EC2 Instances: Status Check Alarms

You are here:
← All Topics

EC2 Instances: Status Check Alarms

EC2 Instances Status Check Alarms

EC2 Instances Status Check Alarms

How to Create and Edit Status Check Alarms?

It is possible to utilize the status check metrics for creating CloudWatch alarms in order to notify you when an instance gets a failed status check.

Create a Status Check Alarm through the Console

Follow the below process for the sake of configuring an alarm that will send you a notification through your email, or stop, terminate, or even recover an instance whenever it fails in a status check.

How to create a status check alarm using the console?

  1. Go to the Amazon EC2 console through this link https://console.aws.amazon.com/ec2/.

    new ec2 experience

    new ec2 experience

  2. From the navigation pane, select Instances.
select ec2 instances

select ec2 instances

  1. Choose an instance, select the Status Checks tab, then click Create Status Check Alarm.
create status check alarm

create status check alarm

  1. Choose to Send a notification to. Select an already existing SNS topic, or otherwise click create a topic for creating a new one. If you choose to create a new topic, inside With these recipients, type in your email address + addresses of other needed recipients, while being separated by commas.
create topic

create topic

  1. It is optional to click on Take the action, then choose the action you’d want to take.

  1. For Whenever, choose the status check that you’d want to get notified about.
status check failed

status check failed

If you have previously chosen Recover this instance during the prior step, choose Status Check Failed (System).

  1. In the section named For at least, specify what number of periods you’d like to evaluate and in the section consecutive periods, choose the evaluation period duration prior to the triggering of the alarm and the sending of an email.

  1. As an optional step, In the section named Name of alarm, change the default name with a new name for the chosen alarm.
name of alarm

name of alarm

 

  1. Click on Create Alarm.
create alarm

create alarm

Important Note

In case you have decided to add an email address to the list of recipients or otherwise went with creating a new topic, Amazon SNS will be sending you a subscription confirmation email message to every new specified address. Every one of the recipients needs to confirm the subscription by selecting the link included in that message. Alert notifications are going to merely be sent to the confirmed addresses.

In case you find yourself in need of making changes to an instance status alarm, you may simply choose to edit it.

 

– Edit a Status Check Alarm Using the Console

How to edit a status check alarm through the console?

  1. Go straight to the Amazon EC2 console using this link https://console.aws.amazon.com/ec2/.
  2. From under the navigation pane, select Instances.
  3. Choose one of the instances and select ActionsCloudWatch Monitoring, and Add/Edit Alarms.
launch instance

launch instance

 

  1. From inside the Alarm Details dialog box, select a name of an alarm.
  2. From inside the Edit Alarm dialog box, perform the required changes you want, then click on Save.

 

– Create a Status Check Alarm Through AWS CLI

In the below mentioned example, you will see that the alarm is going to publish a notification to an SNS topic, arn:aws:sns:us-west-2:111122223333:my-sns-topic, as soon as the instance fails one of the following cases: the instance check or the system status check for a minimum of 2 consecutive periods. The CloudWatch metric which gets utilized here is the StatusCheckFailed.

How to create a status check alarm through the AWS CLI?

  1. Choose an already existing SNS topic or go ahead and start creating a new one.
  2. Utilize the below stated list-metrics command for the sake of viewing all of the available Amazon CloudWatch metrics for your Amazon EC2.

aws cloudwatch list-metrics –namespace AWS/EC2

  1. Utilize the below stated put-metric-alarm command for the goal of creating the alarm.

aws cloudwatch put-metric-alarm –alarm-name StatusCheckFailed-Alarm-for-i-1234567890abcdef0 –metric-name StatusCheckFailed –namespace AWS/EC2 –statistic Maximum –dimensions Name=InstanceId,Value=i-1234567890abcdef0 –unit Count –period 300 –evaluation-periods 2 –threshold 1 –comparison-operator GreaterThanOrEqualToThreshold –alarm-actions arn:aws:sns:us-west-2:111122223333:my-sns-topic

The period refers to the time frame taken in seconds, during which the Amazon CloudWatch metrics will get collected. In this mentioned example the period used is 300, which means 60 seconds taken and multiplied by five minutes.

The evaluation period refers to the number of utilized consecutive periods during which the value of the metric is required to always be compared to the threshold. In this example, the value used is 2. The alarm actions mean the actions to be performed as soon as this alarm will be triggered. In this example, the alarm to send an email is going to be configured through the use of Amazon SNS.

See Also

EC@ launch instance wizard

Table of Contents