- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
The error you're encountering suggests that there's an issue with the parameter store configuration for your CloudWatch agent. The message "ParameterNotFound" indicates that the agent is unable to find the configuration file in the Systems Manager Parameter Store.
To resolve this issue, you need to ensure that your configuration file is properly stored in the Parameter Store. Here are the steps you should follow:
-
First, make sure that your configuration JSON is valid. The JSON you provided looks correct, but it's only a partial configuration focusing on metrics collection for disk and memory.
-
You need to save this configuration to the Parameter Store. Use the AWS Systems Manager put-parameter command to do this. The command should look something like this:
aws ssm put-parameter --name "AmazonCloudwatchagent-Linux" --type "String" --value file://your-config-file.json
Replace "your-config-file.json" with the path to your configuration file.
-
Ensure that the IAM role attached to your EC2 instance has the necessary permissions to access the Parameter Store and CloudWatch. The role should have the CloudWatchAgentServerPolicy attached.
-
After storing the configuration, you can use the Systems Manager Run Command to configure and start the CloudWatch agent. Use the AmazonCloudWatch-ManageAgent document for this purpose.
-
When running the command, make sure to specify the correct parameter name in the "Optional Configuration Source" field. In your case, it should be "AmazonCloudwatchagent-Linux".
If you've followed these steps and are still encountering issues, you may want to check the CloudWatch agent logs for more detailed error messages. On Amazon Linux 2, these logs are typically located at /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log.
Remember, the CloudWatch agent configuration file is quite extensive and can include more sections than just metrics. Depending on your monitoring needs, you might want to include sections for logs collection, agent settings, and other advanced configurations.
Sources
Manually create or edit the CloudWatch agent configuration file - Amazon CloudWatch
Troubleshooting the CloudWatch agent - Amazon CloudWatch
Troubleshoot permission errors for an instance on CloudWatch | AWS re:Post
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
