AWS Systems Manager Run Command Not Working on Amazon Linux AMI Instances

Diagnosing Issues with AWS Systems Manager Run Command

Question

You are trying to use the AWS Systems Manager run command on a set of Amazon Linux AMI Instances.

The run command is not working on a set of Instances.

What can you do to diagnose the issue? (Select TWO.)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer: A and B.

Option A is CORRECT because the first step to troubleshoot the run command issue would be to check if the SSM agent is properly running on the target machine.

Option B is CORRECT because the SSM Agent stores logs in /var/log/amazon/ssm/errors.log.

The information in these log files can help you to troubleshoot problems.

Option C is incorrect because the right AMI has nothing to do with the issues.

The agent which is used to execute run commands can run on a variety of AMIs.

Option D is incorrect because port 22 is not used for the run command in AWS Systems Manager.

For more information on troubleshooting AWS SSM, kindly visit the following URL:

https://docs.aws.amazon.com/systems-manager/latest/userguide/troubleshooting-remote-commands.html

To diagnose the issue with the AWS Systems Manager run command not working on a set of Amazon Linux AMI instances, you can take the following steps:

  1. Ensure that the SSM Agent is running on the target machine: The AWS Systems Manager Agent is required to execute run commands. To check if the SSM Agent is running on the target machine, you can run the following command on the instance:
lua
sudo systemctl status amazon-ssm-agent

If the SSM Agent is not running, you can start it by running the following command:

sql
sudo systemctl start amazon-ssm-agent
  1. Check the /var/log/amazon/ssm/errors.log file: The /var/log/amazon/ssm/errors.log file contains error logs for the SSM Agent. To check if there are any errors related to the run command, you can check this file. You can run the following command to view the log file:
c
sudo less /var/log/amazon/ssm/errors.log

If there are any errors related to the run command, you can use them to diagnose the issue.

  1. Ensure the right AMI is used for the instance: Ensure that you are using the correct Amazon Machine Image (AMI) for the instance. The AMI should be compatible with the version of the SSM Agent you are using. You can check the version of the SSM Agent by running the following command:
sudo amazon-ssm-agent version

Ensure that the AMI you are using is compatible with this version.

  1. Ensure the security groups of the instances allow the incoming traffic from port 22: If you are using port 22 to execute run commands, ensure that the security groups associated with the instances allow incoming traffic from port 22. To check the security group settings, you can go to the EC2 console, select the instance, and check the inbound rules for the associated security group.

By following these steps, you can diagnose the issue with the AWS Systems Manager run command not working on a set of Amazon Linux AMI instances.