Last active
November 18, 2023 14:39
-
-
Save Zer0Divis0r/3207c09c1197e015cc24162bd7f0eba1 to your computer and use it in GitHub Desktop.
Install CloudWatch agent on EC2 Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Attach IAM role to the instance with the following policies: | |
# AmazonSSMManagedInstanceCore | |
# CloudWatchAgentServerPolicy | |
wget https://amazoncloudwatch-agent-eu-central-1.s3.eu-central-1.amazonaws.com/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb | |
sudo dpkg -i -E ./amazon-cloudwatch-agent.deb | |
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard | |
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json | |
sudo service amazon-cloudwatch-agent restart | |
tail -f /opt/aws/amazon-cloudwatch-agent/logs/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment