Skip to content

Instantly share code, notes, and snippets.

@asolera
Last active October 20, 2021 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asolera/0c46bad83bd272ea7899bc09ad675aba to your computer and use it in GitHub Desktop.
Save asolera/0c46bad83bd272ea7899bc09ad675aba to your computer and use it in GitHub Desktop.
Installing AWS CloudAgent on Amazon Linux
#!/bin/sh
# Associate IAM profile (with role `CloudWatchAgentServerRole`) to your EC2 instance
# Install CloudWatch
sudo yum install amazon-cloudwatch-agent -y
# Install CollectD
sudo amazon-linux-extras install collectd -y
# Configure CloudWatch
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
# Start agent
/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment