相关文章推荐

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 TrueSight Capacity Optimization database. Metrics collection using the CloudWatch agent involves the following steps:

The step details are as follows:

    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 .

  1. Configure and run the ETL. For more information, see Amazon Web Services - AWS API Extractor .
  2. 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

TrueSight Capacity Optimization metric Amazon Web Services metric Unit of measure Formula
BYFS_USED disk_used Bytes NA
BYFS_FREE disk_free Bytes NA
BYFS_SIZE disk_total GB NA
CPU_UTIL_IDLE cpu_usage_idle Percent (cpu_usage_idle)/100

CPU_UTIL_NICE

cpu_usage_nice Percent (cpu_usage_nice)/100
CPU_UTIL_SYSTEM cpu_usage_system Percent (cpu_usage_system)/100
CPU_UTIL_WAIO cpu_usage_iowait Percent (cpu_usage_iowait)/100
CPU_UTIL_USER cpu_usage_user Percent (cpu_usage_user)/100
MEM_BUFFERED mem_buffered Megabyte NA
MEM_CACHED mem_cached Megabyte NA
MEM_FREE mem_free Megabyte NA
MEM_REAL_USED mem_used Megabyte NA
MEM_USED Derived Megabyte Derived
MEM_UTIL Derived Percentage Derived
MEM_REAL_UTIL mem_used_percent Percentage (mem_used_percent)/100
SWAP_SPACE_FREE swap_free Bytes NA
SWAP_SPACE_UTIL swap_used_percent Percentage (swap_used_percent)/100
SWAP_SPACE_USED swap_used Bytes NA
TOTAL_FS_FREE - GB Sum of BYFS_FREE
TOTAL_FS_SIZE - GB Sum of BYFS_SIZE
TOTAL_FS_USED - GB Sum of BYFS_USED
TOTAL_FS_UTIL - GB TOTAL_FS_USED/TOTAL_FS_SIZE

Metrics provided for Windows systems

TrueSight Capacity Optimization metric Amazon Web Services metric Unit of measure Formula
BYFS_FREE LogicalDisk Free Megabytes GB (LogicalDisk Free Megabytes * 1024 * 1024)
BYFS_USED (LogicalDisk Free Megabytes, LogicalDisk % Free Space) GB ((LogicalDisk Free Megabytes)*1024*1024)*100/LogicalDisk % Free Space
BYFS_SIZE (LogicalDisk Free Megabytes, LogicalDisk % Free Space) GB ((LogicalDisk Free Megabytes)*1024*1024)*100/LogicalDisk % Free Space
CPU_UTIL_GUEST Processor % Processor Time Percent (Processor % Processor Time)/100
CPU_UTIL_USER Processor % User Time Percentage (PERCENT_USER_TIME)/100
DISK_READ_RATE_GUEST PhysicalDisk Disk Read Bytes/sec KB/sec NA
DISK_WRITE_RATE_GUEST PhysicalDisk Disk Write Bytes/sec KB/sec NA
DISK_IO_READ_RATE_GUEST PhysicalDisk Disk Reads/sec Count NA
DISK_IO_WRITE_RATE_GUEST PhysicalDisk Disk Writes/sec Count NA
MEM_CACHE_FAULTS Memory Cache Faults/sec Count NA
MEM_CACHED Memory System Cache Resident Bytes Bytes NA
MEM_FREE Memory Available Bytes Bytes NA
MEM_PAGE_FAULT_RATE Memory Page Faults/sec Count NA
MEM_PAGE_RATE Memory Pages/sec Count NA
MEM_USED Derived Bytes TOTAL_REAL_MEM - MEM_FREE
MEM_UTIL Derived Percentage MEM_USED/TOTAL_REAL_MEM
MEM_REAL_UTIL MemoryUtilization Percentage MEM_REAL_USED/TOTAL_REAL_MEM
MEM_REAL_USED Derived Bytes MEM_USED - MEM_CACHED
MEM_VIRTUAL_USED_PCT Memory % Committed Bytes In Use Percentage (MEMORY_PERCENT_COMMITTED_BYTES_IN_USE)/100
TOTAL_FS_SIZE - GB Sum of BYFS_SIZE
TOTAL_FS_FREE - GB Sum of BYFS_FREE
TOTAL_FS_USED - GB Sum of BYFS_USED
TOTAL_FS_UTIL - GB TOTAL_FS_USED/TOTAL_FS_SIZE
acceptance of BMC’s Terms of Use . BMC, the BMC logo, and other BMC marks are assets of BMC Software, Inc. These trademarks are registered may be registered in the U.S. and in other countries.
 
推荐文章