Troubleshooting issues in configuring CloudWatch agent in an EC2 instance

Troubleshooting issues in configuring CloudWatch agent in an EC2 instance


This document helps in troubleshooting the errors and issues while configuring CloudWatch agent in an EC2 Instance.

Pre-requisites

  1. Please follow the pre-requisites to configure the CloudWatch agent for an EC2 instance.
    1. Ensure you have followed all the steps mentioned in the Overview of prerequisites section.

What are the supported metrics for EC2 Instance using CloudWatch agent in Applications Manager?

Refer here to know the supported OS level metrics for an EC2 Instance in Applications Manager. However, please find the metric names in CloudWatch console for the same below:
  1. Windows

    1. LogicalDisk
      1. % Free Space
      2. Free Megabytes
    2. Memory
      1. % Committed Bytes In Use
      2. Available MBytes
      3. Committed Bytes
Info
Use the below JSON while configuring the CloudWatch agent for Windows:
{ "metrics": { "append_dimensions": { "InstanceId": "${aws:InstanceId}" }, "metrics_collected": { "LogicalDisk": { "measurement": [ "% Free Space", "Free Megabytes" ], "metrics_collection_interval": 300, "resources": [ "*" ] }, "Memory": { "measurement": [ "% Committed Bytes In Use", "Available MBytes", "Committed Bytes" ], "metrics_collection_interval": 300 } } } }
  1. Linux

    1. Memory
      1. mem_total
      2. mem_used
    2. Disk
      1. disk_total
      2. disk_used
    3. Swap
      1. swap_used_percent

Info
Use the below JSON while configuring the CloudWatch agent for Linux:
{ "metrics": { "append_dimensions": { "InstanceId": "${aws:InstanceId}" }, "metrics_collected": { "mem": { "measurement": [ "mem_total", "mem_used" ], "metrics_collection_interval": 300 }, "disk": { "resources": [ "/", "/run" ], "measurement": [ "disk_total", "disk_used" ], "metrics_collection_interval": 300 }, "swap": { "measurement": [ "swap_used_percent" ], "metrics_collection_interval": 300 } } } }

Warning
Use the JSON provided in the prerequisites to configure the CloudWatch agent. Only if all the metrics given in prerequisites are present in the CloudWatch, Applications Manager will proceed for the data collection of the OS metrics.

How to verify if the CloudWatchAgentServerRole is attached to the EC2 instance?

  1. Go to AWS console > EC2 > Instances > choose the instance.
  2. In the EC2 instance page, click Actions in the top right > Security > Modify IAM role.
  3. Verify whether the CloudWatchAgentServerRole is attached as mentioned in the pre-requisites step 1 & 2.
Alert
This is mandatory to allow the CloudWatch agent to send the collected data to CloudWatch.


No data for OS metrics in EC2 instance monitor in Applications Manager

  1. Verify if the JSON used to configure the CloudWatch agent is same as given in pre-requisites.
  1. Before Applications Manager version v16320, the dimension should be only 'InstanceId'; otherwise, the data will not be populated. Ensure that the configuration matches the given JSON. However, starting from Applications Manager v16320, we have removed this limitation and now support multiple dimensions.
  1. Ensure all the metrics mentioned in the supported metrics section is present in the namespace.
  2. Verify if the CWAgent namespace is present in the CloudWatch console.
    1. To verify, navigate to AWS console > Choose region of the EC2 Instance > CloudWatch console > Metrics > All metrics.
Reference images to verify the steps mentioned:

CWAgent namespace


Search with the instance ID > select all the metrics from result > go to Graphed metrics tab


Windows metrics


Linux metrics


Notes
If the issue still persists, please reach out via mail to appmanager-support@manageengine.com with the below information:
  1. Latest Support Information File (SIF)ensure that 'print all logs' is enabled.
  2. Screenshot of the above mentioned information from the pre-requisites.
    1. JSON content used to configure the CloudWatch agent.
    2. Screenshot of the details (reference images from above) from AWS console.

                  New to ADSelfService Plus?

                    • Related Articles

                    • Real User Monitor (RUM) - Troubleshooting

                      If the monitor has not polled data for a long time, follow the steps below for troubleshooting: Step 1: Check the RUM Agent configuration Real User Monitor requires the RUM Agent to be installed and mapped to the Applications Manager. Refer the help ...
                    • EUM Agent Troubleshooting

                      1. EUM Agent not mapped to Applications Manager. What should I do? If EUM Agent is not mapped, troubleshoot the problem by following the steps given below : Verify whether the EUM Agent is up and running. Check if you can reach the Applications ...
                    • AWS EKS Troubleshooting FAQs

                      AWS EKS monitor can be configured only if you have already added an Amazon monitor in Applications Manager. Ensure that you have met the pre-requisites for the Amazon monitor before monitoring Elastic Kubernetes Service in Applications Manager. How ...
                    • How to rename an existing APM - Java agent application's monitor?

                      In Applications Manager's APM(Application Performance Monitoring) doesn't support renaming applications/monitors from the web client. However, the application name of an existing application instance can be renamed in the `apminsight.conf` file and ...
                    • Troubleshooting Inconsistent .NET Core monitors Availability

                      Issue: Some applications are experiencing inconsistent availability status, where they appear to be active but are reported as "down." This issue can occur due to the nature of application monitoring and how the monitoring agent interacts with the ...