Last active
May 10, 2018 14:54
-
-
Save fijimunkii/b6950f254aba00a3e523f8855fd365a1 to your computer and use it in GitHub Desktop.
aws cloudwatch logs and metrics setup
This file contains hidden or 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
# ensure the instance has a role with CloudWatchAgentServerPolicy | |
# cloudwatch logs (awslogs) | |
curl https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -O | |
sudo python ./awslogs-agent-setup.py --region us-east-1 | |
# cloudwatch metrics | |
wget https://s3.amazonaws.com/amazoncloudwatch-agent/linux/amd64/latest/AmazonCloudWatchAgent.zip | |
unzip AmazonCloudWatchAgent.zip | |
sudo ./install.sh | |
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 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment