Monitor Amazon ECS container instance health - Amazon Elastic Container Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Monitor Amazon ECS container instance health

Amazon ECS provides container instance health monitoring. You can quickly determine whether Amazon ECS has detected any problems that might prevent your container instances from running containers. Amazon ECS performs automated checks on every running container instance with agent version 1.57.0 or later to identify issues. For more information on verifying the agent version an a container instance, see Updating the Amazon ECS container agent.

You must be using Amazon CLI version 1.22.3 or later or Amazon CLI version 2.3.6 or later. For information about how to update the Amazon CLI, see Installing or updating the latest version of the Amazon CLI in the Amazon Command Line Interface User Guide Version 2.

Status checks are performed about twice per 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 ECS container agent, so they cannot be turned off or deleted. You can view the results of these status checks to identify specific and detectable problems. For more information, see Health check.

Run the DescribeContainerInstances API with the CONTAINER_INSTANCE_HEALTH option to retrieve the container instance health.

aws ecs describe-container-instances \ --cluster cluster_name \ --container-instances 47279cd2cadb41cbaef2dcEXAMPLE \ --include CONTAINER_INSTANCE_HEALTH

The following is an example of the health status object in the output.

"healthStatus": { "overallStatus": "OK", "details": [{ "type": "CONTAINER_RUNTIME", "status": "OK", "lastUpdated": "2021-11-10T03:30:26+00:00", "lastStatusChange": "2021-11-10T03:26:41+00:00" }] }

Related topics