Overview
To ensure that the EC2 instances are running as expected, AWS performs status checks on them. These checks can help you determine whether your instance is facing issues that require your intervention.
Status checks are performed every minute, returning a pass or a fail status. If all checks pass, the overall status of the instance is OK. If one or more checks fail, the overall status is impaired. Status checks are built into Amazon EC2, so they cannot be disabled or deleted.
There are two main types of status checks: System Status Checks and Instance Status Checks.
System Status Checks:
These checks verify the underlying physical hardware and software that support the instance.
If there's a problem with a System Status Check, it's typically related to:
Loss of network connectivity.
Loss of system power.
Software issues on the physical host.
Hardware issues on the physical host that impact network reachability.
Remediation Actions:
- If there's a system status check failure, you often need to wait as AWS might automatically recover it. If not, you can try stopping and starting the instance, which causes it to be migrated to a different underlying host.
Instance Status Checks:
These checks verify the software and network configuration of the individual instance. Amazon EC2 checks the health of the instance by sending an address resolution protocol (ARP) request to the network interface (NIC). These checks detect problems that require your involvement to repair.
If there's a problem with an Instance Status Check, it might be due to:
Incorrect network configuration.
Exhausted memory.
Corrupted file system.
Incompatible kernel.
Remediation Actions:
- Issues with instance status checks often require intervention on the user's part. This could be tasks like checking instance configuration, rebooting the instance, making sure your application is running correctly, or even checking for disk space issues.
In the AWS Management Console, the status checks are typically displayed as pass (2/2 checks passed), warning (1/2 checks passed), or fail (0/2 checks passed).
When a status check fails, the corresponding CloudWatch metric for status checks is incremented. For more information, see Status check metrics. You can use these metrics to create CloudWatch alarms that are triggered based on the result of the status checks. For example, you can create an alarm to warn you if status checks fail on a specific instance. For more information, see Create and edit status check alarms.
You can also create an Amazon CloudWatch alarm that monitors an Amazon EC2 instance and automatically recovers the instance if it becomes impaired due to an underlying issue. For more information, see Recover your instance.
View status using the console
To view status checks using the Amazon EC2 console, perform the following steps.
To view status checks (console)
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
In the navigation pane, choose Instances.
On the Instances page, the Status check column lists the operational status of each instance.
To view the status of a specific instance, select the instance, and then choose the Status checks tab.
If your instance has a failed status check, you typically must address the problem yourself (for example, by rebooting the instance or by making instance configuration changes). To troubleshoot system or instance status check failures yourself, see Troubleshoot instances with failed status checks.
To review the CloudWatch metrics for status checks, select the instance, and then choose the Monitoring tab. Scroll until you see the graphs for the following metrics:
Status check failed (any)
Status check failed (instance)
Status check failed (system)
For more information, see Status check metrics.
View status using the command line
You can view status checks for running instances by using the describe-instance-status (AWS CLI) command.
To view the status of all instances, use the following command.
aws ec2 describe-instance-status
To get the status of all instances with an instance status of impaired
, use the following command.
aws ec2 describe-instance-status \
--filters Name=instance-status.status,Values=impaired
To get the status of a single instance, use the following command.
aws ec2 describe-instance-status \
--instance-ids i-1234567890abcdef0
Alternatively, use the following commands:
Get-EC2InstanceStatus (AWS Tools for Windows PowerShell)
DescribeInstanceStatus (Amazon EC2 Query API)
If you have an instance with a failed status check, see Troubleshoot instances with failed status checks.
Create a status check alarm using the console
Use the following procedure to configure an alarm that sends you a notification by email, or stops, terminates, or recovers an instance when it fails a status check.
To create a status check alarm (console)
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
In the navigation pane, choose Instances.
Select the instance, choose the Status Checks tab, and choose Actions, Create status check alarm.
On the Manage CloudWatch alarms page, under Add or edit alarm, choose Create an alarm.
For Alarm notification, turn the toggle on to configure Amazon Simple Notification Service (Amazon SNS) notifications. Select an existing Amazon SNS topic or enter a name to create a new topic.
If you add an email address to the list of recipients or created a new topic, Amazon SNS sends a subscription confirmation email message to each new address. Each recipient must confirm the subscription by choosing the link contained in that message. Alert notifications are sent only to confirmed addresses.
For Alarm action, turn the toggle on to specify an action to take when the alarm is triggered. Select the action.
For Alarm thresholds, specify the metric and criteria for the alarm.
You can leave the default settings for Group samples by (Average) and Type of data to sample (Status check failed:either), or you can change them to suit your needs.
For Consecutive period, set the number of periods to evaluate and, in Period, enter the evaluation period duration before triggering the alarm and sending an email.
(Optional) For Sample metric data, choose Add to dashboard.
Choose Create.
If you need to make changes to an instance status alarm, you can edit it.