Skip to content

Instantly share code, notes, and snippets.

@soloradish
Created September 19, 2018 08:07
Show Gist options
  • Save soloradish/dc70a4c1b67e050b082052a59fe86193 to your computer and use it in GitHub Desktop.
Save soloradish/dc70a4c1b67e050b082052a59fe86193 to your computer and use it in GitHub Desktop.
Script download verify install Amazon CloudWatch Agent
#!/usr/bin/env bash
# require wget, unzip, gpg installed
# download package, gpg public key and signature files.
set -x
set -e
pushd $(mktemp -d)
wget https://s3.amazonaws.com/amazoncloudwatch-agent/linux/amd64/latest/AmazonCloudWatchAgent.zip
wget https://s3.amazonaws.com/amazoncloudwatch-agent/linux/amd64/latest/AmazonCloudWatchAgent.sig
wget https://s3.amazonaws.com/amazoncloudwatch-agent/assets/amazon-cloudwatch-agent.gpg
set +e
gpg --import amazon-cloudwatch-agent.gpg
set -e
gpg --verify AmazonCloudWatchAgent.sig AmazonCloudWatchAgent.zip
unzip ./AmazonCloudWatchAgent.zip
./install.sh
echo -e "Amazon CloudWatch Agent install at /opt/aws/amazon-cloudwatch-agent/"
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment