SSM agent offline.

10/09/2023

If the AWS Systems Manager (SSM) agent on your EC2 instance is offline, it means that the agent is not currently running or not able to communicate with the Systems Manager service. Here are steps you can take to troubleshoot and resolve this issue:

  1. Check SSM Agent Status:
    • Log in to the affected EC2 instance and verify if the SSM agent is running. You can check its status with the following command:
      lua
      


  • systemctl status amazon-ssm-agent
    
  • If it's not running, start the agent:
    sql
    
      • sudo systemctl start amazon-ssm-agent
        
    1. Verify IAM Role and Policies:
      • Ensure that the EC2 instance has an associated IAM role with the necessary policies (e.g., AmazonSSMManagedInstanceCore) to allow it to communicate with the Systems Manager.
    2. Check Security Group and NACL Settings:
      • Verify that the EC2 instance's security group and Network Access Control Lists (NACLs) allow outbound traffic on port 443 (HTTPS) to communicate with the Systems Manager service.
    3. Check Internet Connectivity:
      • Ensure that the EC2 instance has internet connectivity to reach the Systems Manager service. It may need to access AWS services over the internet or through a VPC endpoint.
    4. Review SSM Agent Logs:
      • Check the SSM agent logs for any error messages or warnings. The logs are typically located in one of the following paths:
        • Linux: /var/log/amazon/ssm/amazon-ssm-agent.log
        • Windows: C:\ProgramData\Amazon\SSM\Logs\amazon-ssm-agent.log
    5. Verify EC2 Instance Tags:
      • Ensure that the EC2 instance has the necessary tags (e.g., Name, aws:cloudformation:stack-name, etc.) for the Systems Manager to identify and manage it.
    6. Check EC2 Instance State:
      • Ensure that the EC2 instance is in a running state and is not terminated or stopped.
    7. Verify Systems Manager Agent Version:
      • Make sure that you are using a supported version of the SSM agent. Outdated versions may have compatibility issues.
    8. Check for EC2 Instance Health:
      • Review the CloudWatch metrics for the EC2 instance to check for any issues with CPU, memory, disk space, etc.
    9. Restart the EC2 Instance:
      • In some cases, a simple reboot of the EC2 instance can resolve connectivity issues.
    10. Reinstall SSM Agent (if necessary):
      • If none of the above steps resolve the issue, consider reinstalling the SSM agent on the EC2 instance.

    If none of these steps resolve the issue, you may need to gather additional information from the logs and consider reaching out to AWS Support for further assistance. They can provide specific guidance based on the details of your environment and the SSM agent logs.

    Comments

    No posts found

    Write a review