0% found this document useful (0 votes)
3 views3 pages

Cwagent Installation

This document outlines the steps to install the CloudWatch agent on an instance using the command line interface (CLI). It includes instructions for connecting to the instance, downloading the appropriate CloudWatch agent package for different Linux distributions, installing it, configuring it, and starting the agent. Finally, it provides a command to check the status of the agent to ensure it is properly installed and reflected in CloudWatch metrics.

Uploaded by

srout22aug
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Cwagent Installation

This document outlines the steps to install the CloudWatch agent on an instance using the command line interface (CLI). It includes instructions for connecting to the instance, downloading the appropriate CloudWatch agent package for different Linux distributions, installing it, configuring it, and starting the agent. Finally, it provides a command to check the status of the agent to ensure it is properly installed and reflected in CloudWatch metrics.

Uploaded by

srout22aug
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

How to install CloudWatch agent in an instance

using CLI
Step1-
Connect the instance using CLI , using any one of these-SSM or through putty SSH using the
credentials.
Step 2-
Go to the root user first. Use the following command to login as root user
sudo su
Step 3-
We need to download the cwagent to the instance to do that use following command:
1. Download Cloudwatch agent

wget https://s3.amazonaws.com/amazoncloudwatch-agent/redhat/amd64/latest/amazon-
cloudwatch-agent.rpm --Redhat
wgethttps://s3.amazonaws.com/amazoncloudwatchagent/amazon_linux/amd64/latest/
amazon-cloudwatch-agent.rpm
--Linux
wget https://s3.amazonaws.com/amazoncloudwatch-agent/centos/amd64/latest/amazon-
cloudwatch-agent.rpm (Centos)
wget https://s3.amazonaws.com/amazoncloudwatch-agent/debian/amd64/latest/amazon-
cloudwatch-agent.deb Ubuntu

Step 4:
Install it using these commands:
sudo rpm -U ./amazon-cloudwatch-agent.rpm
sudo dpkg -i -E ./amazon-cloudwatch-agent.deb
Step-5:
Configure the cwagent using this command:
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
Step 6:

Start the agent that you have installed using this command:

sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config


-m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s

Step 7:
Check the status of instance using this command:
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a
status

The cwagent is now installed properly on the instance and now it should be reflected on the
metrices in the CloudWatch services.

You might also like