Cwagent Installation
Cwagent Installation
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:
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.