Skip to content

Issue with CloudWatch agent configuration

0

CW agent was already configured and works. I need to make some changes. The proxy configuration in env-config.json file gets reverted after restarting the CW service. What's the issue here?

2 Answers
1

Hello,

In the AWS documentation, I found the following information:

If you update your CloudWatch agent configuration file, the next time that you start the agent, you need to use the fetch-config option.

Try starting the agent using the following command:

sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -s -m ec2 -c file:configuration-file-path

You need to replace configuration-file-path with the path to env-config.json.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/troubleshooting-CloudWatch-Agent.html#CloudWatch-Agent-troubleshooting-update-no-new-metrics

answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
  • It doesn't work. sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -s -m ec2 -c file:opt/aws/amazon-cloudwatch-agent/etc/env-config.json. It throws an error "Error running agent: no outputs found, did you provide a valid config file?

  • If the CloudWatch agent fails to start, there might be an issue in your configuration. Configuration information is logged in the configuration-validation.log file. This file is located in /opt/aws/amazon-cloudwatch-agent/logs/configuration-validation.log.

    It is recommended to check the configuration file. Providing the configuration file could help in resolving the issue.

0

Hello,

It sounds like the issue is with the CloudWatch agent not recognizing your updated configuration file. Make sure the path to env-config.json is correct and that the file is properly formatted. The error message indicates it couldn't find valid outputs in your configuration. Double-check your configuration file and try restarting the agent with the correct path. If the issue persists, verify the file’s content and format against AWS documentation or consider seeking further support.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/troubleshooting-CloudWatch-Agent.html

EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.