Collecting EC2 instance metrics by using the CloudWatch agent


You can use the CloudWatch agent to collect the system-level metrics from your AWS EC2 instances. These metrics are useful for investigating the capacity-related issues that might occur in your AWS cloud environment. The CloudWatch agent collects these metrics and sends them to Amazon CloudWatch. When you run the AWS API ETL, these metrics are imported into the BMC Helix Continuous Optimization database. Metrics collection using the CloudWatch agent involves the following steps:

cloudwatch_agent_steps_flowchart.png

The step details are as follows:

  1. Install, configure, and start the CloudWatch Agent.
    1. Create IAM roles and users. These roles and users permit the CloudWatch agent to send metrics to CloudWatch. For more information, see Create IAM Roles and Users for Use With CloudWatch Agent.

    2. Install the SSM Agent on the EC2 instances. For more information, see Manually Install SSM Agent on Amazon EC2 Linux Instances.

    3. Install the CloudWatch agent on the EC2 instances. For information, see Getting Started: Installing the CloudWatch Agent on Your First Instance.

    4. Verify that the CloudWatch agent service is up and running:
      • (Windows) Open Windows services, and check whether the service is running.
      • (Linux) Run this command: sudo /bin/systemctl status amazon-cloudwatch-agent.service
    5. Verify that the CloudWatch agent is started:
      • (Windows) <agent_installation_directory_path>\amazon-cloudwatch-agent-ctl -m ec2 -a status
        For example, C:\Program Files\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent-ctl -m ec2 -a status
      • (Linux) <agent_installation_directory_path>/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a status
        For example, sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a status
    6. Download the attached agent configuration file that contains the metrics to be collected by the agent.
      1. Log in to the EC2 instance.
      2. Download the attached file:
      3. Rename the file as amazon-cloudwatch-agent and save it at the following location:
        • (Windows) C:\Program Files\Amazon\AmazonCloudWatchAgent\bin
        • (Linux) /opt/aws/amazon-cloudwatch-agent/bin
    7. Run the following command to start data collection:

      • (Windows) <agent_installation_directory_path>\amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:C:\Program Files\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent.json -s
        For example, C:\Program Files\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:C:\Program Files\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent.json -s
      • (Linux) <agent_installation_directory_path>/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent.json -s
        For example, sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent.json -s

      The agent starts collecting metrics and data from EC2 instances and sends them to CloudWatch.

    You can create your own agent configuration file and use it to start the agent on all your EC2 instances. For more information, see Installing CloudWatch Agent on Additional Instances Using Your Agent Configuration.

    You can use the command line for installing and starting the agent instead of Systems Manager. For more information, see Getting Started: Installing the CloudWatch Agent on Your First Instance.

    To troubleshoot issues with the CloudWatch agent, see Troubleshooting the CloudWatch Agent.

  2. Configure and run the ETL. For more information, see Amazon-Web-Services-AWS-API-Extractor.
  3. Verify that the metrics are displayed in the Workspace.

The following tables lists the metrics provided by the CloudWatch agent that the ETL collects:

Metrics provided for Linux systems


Metrics provided for Windows systems

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*