1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
CPU usage can be checked from Lightsail without looking at CloudWatch.
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/understanding-instance-health-metrics-in-amazon-lightsail
A CloudWatch agent configuration file must be created to output CPU usage and memory to CloudWatch.
Looking at the URL you provided, there seems to be a configuration file in "/opt/aws/amazon-cloudwatch-agent/bin/config.json", so edit this.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html
The following settings will output memory usage and CPU usage.
{
"metrics": {
"metrics_collected": {
"cpu": {
"measurement": [
"cpu_usage_idle",
"cpu_usage_iowait"
]
},
"mem": {
"measurement": [
"mem_used_percent"
]
}
}
}
}
After updating the file, restart CloudWatch Agent with the following command.
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a stop
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
Relevant content
- asked 4 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 5 months ago