简体   繁体   中英

AWS CloudWatch sending logs but not custom metrics to CloudWatch

first time asker.

So I've been trying to implement AWS Cloud Watch to monitor Disk Usage on an EC2 instance running EC2 Linux. I'm interesting in doing this just using the CW Agent and I've installed it according to the how-to found here . The install runs fine and I've made sure I've created an IAM Role for the instance as is described here . Unfortunately whenever I run the amazon-cloudwatch-agent.service it only sends log files and not the custom used_percent measurement specified. I receive this error when I tail the logs.

2021-06-18T15:41:37Z E! WriteToCloudWatch failure, err:  RequestError: send request failed

caused by: Post "https://monitoring.us-west-2.amazonaws.com/": dial tcp 172.17.1.25:443: i/o timeout

I've done my best googlefu but gotten nowhere thus far. If you've got any advice it would be appreciated.

Thank you

Belated answer to my own question. I had to create a security group that would accept traffic from that same security group!

Having the same issue, it definitely wasn't a.network restriction as I was still able to te.net to the monitoring endpoint.

From AWS docs: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-iam-roles-for-cloudwatch-agent.html

One role or user enables CloudWatch agent to be installed on a server and send metrics to CloudWatch. The other role or user is needed to store your CloudWatch agent configuration in Systems Manager Parameter Store. Parameter Store enables multiple servers to use one CloudWatch agent configuration.

If you're using the default cloudwatchagent configuration wizard, you may require extra policy CloudWatchAgentAdminRole in your role for the agent to connect to the monitoring service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM