Troubleshooting SSM Run Command
This topic includes information to help you troubleshoot problems with SSM Run Command. For information about troubleshooting Run Command for Windows, see Troubleshooting Running Command in the User Guide for Microsoft Windows.
Where Are My Instances?
If you are attempting to execute commands with Run Command using the Amazon EC2 console and you do not see the expected list of instances when you choose Select Target instances, then one or more of the prerequisites have not been met for the missing instances. For more information, see SSM Run Command Prerequisites.
Check Instance Status Using the Health API
You can use the Amazon EC2 Health API to quickly determine the following information about Amazon EC2 instances:
The version of the SSM agent
The status of one or more instances
The operating system
The status of the SSM agent
The last time the instance sent a heartbeat value
Use the following command to get status details about one or more instances:
aws ssm describe-instance-information --instance-information-filter-list key=InstanceIds,valueSet=instance-IDUse the following command with no filters to see all instances registered to your account that are currently reporting an online status. Substitute the ValueSet=”Online” with "ConnectionLost" or "Inactive" to view those statuses:
aws ssm describe-instance-information --instance-information-filter-list key=PingStatus,valueSet=OnlineUse the following command to see which instances are running the latest version of the SSM agent. Substitute ValueSet=”LATEST” with a specific version (for example, 1.0.145 or 1.0) to view those details:
aws ssm describe-instance-information --instance-information-filter-list key=AgentVersion,valueSet=LATESTIf the describe-instance-information API operation returns an AgentStatus of Online, then your instance is ready to be managed using Run Command. If the status is Inactive, the instance has one or more of the following problems.
The SSM agent is not installed. For more information, see Configuring the SSM Agent.
The instance does not have outbound internet connectivity.
The instance was not launched with an IAM role that enables it to communicate with the SSM API, or the permissions for the IAM role are not correct for Run Command. For more information, see Configuring IAM Roles and Users for SSM Run Command.
Troubleshooting the Amazon SSM Agent
If you experience problems executing commands with Run Command, there might be a problem with the SSM agent. Use the following information to help you troubleshoot the agent.
View Agent Logs
The SSM agent logs information in the following files using cihub/seelog. The information in these files can help you troubleshoot problems.
/var/log/amazon/ssm/amazon-ssm-agent.log
/var/log/amazon/ssm/error.log
You can enable extended logging by updating the seelog.xml file. By default, the configuration file is located here: /opt/amazon/ssm/seelog.xml.
For more information about cihub/seelog configuration, go to the cihub/seelog Wiki. For examples of cihub/seelog configurations, go to cihub/seelog examples.

