Installing CloudWatch Agent on amazon linux 1
Abstract::
- Add
CloudWatchAgentServerPolicy
policy to EC2 instance IAM role - Install CloudWatch Agent ( amazon linux 1 ):
- Create a file
/opt/aws/amazon-cloudwatch-agent/bin/config.json
and add custom metrics needed for monitoring. Example:
{
"metrics": {
"metrics_collected": {
"mem": {
"measurement": [
"mem_used_percent"
],
"metrics_collection_interval": 60
},
"disk": {
"measurement": [
"disk_used_percent"
],
"metrics_collection_interval": 60
}
}
}
}
- Start cloudwatch agent.
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