Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get AWS Status Checks for an Instance

I am trying to retrieve, via AMAZON CLI tools, the 'Status Checks' information, which is displayed for an EC2 Instance in the console. For example 'Pending' or '2/2 checks passed'. I have used the following command:

  ec2-describe-instances [instance_id ...]

However, it only returns Instance State info such as 'Running', 'Stopping' etc. I want the more granular information as displayed in the Status Checks column in the AWS Console. Does anyone know the command to retrieve this information for an instance?

like image 436
user1654528 Avatar asked Oct 18 '25 10:10

user1654528


1 Answers

You're looking for describe-instance-status. This will return, among other things, both the System Status and Instance Status as displayed on the 'Status Check' tab in the EC2 web console.

Example Request as made for a running, healthy instance:

aws ec2 describe-instance-status --instance-ids i-abcd1234

Example Output as made for a running, healthy instance:

{
    "InstanceStatuses": [
        {
            "InstanceId": "i-abcd1234",
            "InstanceState": {
                "Code": 16,
                "Name": "running"
            },
            "AvailabilityZone": "us-east-1a",
            "SystemStatus": {
                "Status": "ok",
                "Details": [
                    {
                        "Status": "passed",
                        "Name": "reachability"
                    }
                ]
            },
            "InstanceStatus": {
                "Status": "ok",
                "Details": [
                    {
                        "Status": "passed",
                        "Name": "reachability"
                    }
                ]
            }
        }
    ]
}

If you want to review historical status checks, you can do so via CloudWatch (linked documentation) by reviewing the following EC2 metrics:

  • StatusCheckFailed_Instance
  • StatusCheckFailed_System
like image 125
Anthony Neace Avatar answered Oct 21 '25 01:10

Anthony Neace



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!