Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Kalki5/7a1af8c1c0c3f28d164bf85f6fcfe66c to your computer and use it in GitHub Desktop.
Save Kalki5/7a1af8c1c0c3f28d164bf85f6fcfe66c to your computer and use it in GitHub Desktop.
Install AWS Cloud Watch Agent on Ubuntu. Custom Logs and custom metrics
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:DescribeLogStreams"
],
"Resource": [
"arn:aws:logs:*:*:*"
]
}
]
}
sudo apt-get install -y python-pip
pip install awscli
aws configure
curl https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -O
sudo python ./awslogs-agent-setup.py --region us-east-1
*/5 * * * * ~/aws-scripts-mon/mon-put-instance-data.pl --mem-util --disk-space-util --disk-path=/ --from-cron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment