Created
November 7, 2018 03:43
-
-
Save it-am/d4d47ccd253a2a5af7a6bc6258d0403a to your computer and use it in GitHub Desktop.
install-cloudwatchagent-ubuntu-userdata
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
#!/bin/bash | |
mkdir tempcloudwatch | |
cd tempcloudwatch | |
apt install wget -y | |
apt install unzip -y | |
wget https://s3.amazonaws.com/amazoncloudwatch-agent/linux/amd64/latest/AmazonCloudWatchAgent.zip | |
unzip AmazonCloudWatchAgent.zip | |
sudo ./install.sh | |
wget https://YOUR-PUBLIC-URL-HERE-WITH-CONFIG-FILE -O config.json | |
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:config.json -s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment