Menu
Amazon CloudWatch
User Guide

Collect Metrics from Amazon EC2 Instances and On-Premises Servers with the CloudWatch Agent

The CloudWatch agent enables you to do the following:

  • Collect more system-level metrics and logs from Amazon EC2 instances, including in-guest metrics, in addition to the metrics listed in Amazon EC2 Metrics and Dimensions. The additional metrics are listed in Metrics Collected by the CloudWatch Agent.

  • Collect system-level metrics and logs from on-premises servers. These can include servers in a hybrid environment as well as servers not managed by AWS.

In both cases, you can store and view these metrics in CloudWatch just as you can with any other CloudWatch metrics. The default namespace for metrics collected by the CloudWatch agent is CWAgent, although you can specify a different namespace when you configure the agent.

Metrics collected by the CloudWatch agent are billed as custom metrics. For more information about CloudWatch metrics pricing, see Amazon CloudWatch Pricing.

The steps in this section explain how to install the CloudWatch agent on Amazon EC2 instances and on-premises servers. For more information about the metrics collected by the CloudWatch agent, see Metrics Collected by the CloudWatch Agent.

Supported Operating Systems

The CloudWatch agent is supported on the following operating systems:

  • Amazon Linux version 2014.03.02 or later

  • Ubuntu Server version 16.04 and 14.04

  • CentOS version 7.0 and 6.5

  • Red Hat Enterprise Linux (RHEL) version 7.4, 7.0, and 6.5

  • Debian 8.0

  • 64-bit versions of Windows Server 2016, Windows Server 2012, and Windows Server 2008.

Installation Process Overview

The general flow of installing the CloudWatch agent is as follows:

  1. Create the IAM roles and users that you need for the CloudWatch agent. They enable CloudWatch to collect metrics from the server, and to integrate with AWS Systems Manager.

  2. If you are installing on an Amazon EC2 instance, attach an IAM role to the instance. If you are installing on an on-premises server, create an IAM user for CloudWatch agent.

  3. Download the agent package, using either AWS Systems Manager Run Command or a public Amazon S3 download link.

  4. Modify the CloudWatch agent configuration files, and create a named profile for CloudWatch agent. Creating the named profile is optional when installing the agent on an Amazon EC2 instance.

  5. Start the agent, using either Systems Manager Run Command or the command line.