The CloudWatch agent is running, but no `mem_used_percent` or disk metrics appear in the `CWAgent` namespace.
IntermediateTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer
Likely causes → The agent was started with the default or no config, so the metrics section is missing. Other causes: the instance role has no CloudWatchAgentServerPolicy, or the agent cannot reach the CloudWatch endpoint (private subnet with no monitoring endpoint).
Diagnose →
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a status
sudo tail -50 /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log
aws cloudwatch list-metrics --namespace CWAgent --dimensions Name=InstanceId,Value=i-0abc
Fix →
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
-a fetch-config -m ec2 -s -c ssm:AmazonCloudWatch-linux
Attach CloudWatchAgentServerPolicy, and add the monitoring and logs endpoints for private subnets.
Prevent → Store the agent config in SSM Parameter Store, and push it with State Manager to every instance.
More on CloudFormation, CloudWatch, KMS, Secrets and Cost
Updating a stack fails: `Stack:arn:aws:cloudformation:...:stack/app/... is in ROLLBACK_COMPLETE state and can not be updated.`BeginnerA stack is stuck in `UPDATE_ROLLBACK_FAILED`.AdvancedA pipeline fails with `An error occurred (ValidationError) when calling the UpdateStack operation: No updates are to be performed.`Beginner`InsufficientCapabilitiesException: Requires capabilities : [CAPABILITY_NAMED_IAM]`.BeginnerStack deletion ends in `DELETE_FAILED` with `The bucket you tried to delete is not empty` on an S3 bucket resource.IntermediateDrift detection shows `MODIFIED` on a security group and an RDS instance that someone changed in the console. How do you reconcile?Advanced