liveBook · Manning

System status metric

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

An EC2 system status metric records the results of AWS checks on the underlying host system of an instance.

An EC2 system status metric records AWS checks of the underlying host system supporting an instance. EC2 publishes StatusCheckFailed_System every minute; a failed check adds a datapoint with value 1. section 13.1

Use this metric with a CloudWatch alarm to detect host failure and invoke EC2 recovery. The alarm evaluates a threshold over time before changing to ALARM and triggering its action. section 13.1

Listing 13.2 Creating a CloudWatch alarm to recover a failed EC2 instance
RecoveryAlarm:                                              #1
  Type: 'AWS::CloudWatch::Alarm'
  Properties:
    AlarmDescription: 'Recover EC2 instance when underlying hardware fails.'
    Namespace: 'AWS/EC2'                                    #2
    MetricName: 'StatusCheckFailed_System'                  #3
    Statistic: Maximum                                      #4
    Period: 60                                              #5
    EvaluationPeriods: 5                                    #6
    ComparisonOperator: GreaterThanThreshold                #7
    Threshold: 0                                            #8
    AlarmActions:                                           #9
    - !Sub 'arn:aws:automate:${AWS::Region}:ec2:recover'
    Dimensions:
    - Name: InstanceId                                      #10
      Value: !Ref Instance

This CloudFormation listing configures the AWS/EC2 namespace, StatusCheckFailed_System metric, five evaluation periods, and the EC2 recovery action. section 13.1

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Defines one-minute failure datapoints, then applies the metric in a threshold-based, five-period recovery alarm.
Examples
Uses a Jenkins EC2 server whose underlying-host failure triggers recovery through a CloudFormation alarm.
What you can do after
Configure automatic EC2 recovery by selecting this metric in a CloudWatch alarm.
How it connects
Connects EC2, CloudWatch alarms, instance recovery, CloudFormation, and Elastic IP addresses.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.