The CloudWatch Agent has been installed and configured. There is an IAM profile that allows communications. The configuration is correct, as there are several other installations managed using this configuration without problems. Just having trouble with this particular case.
In the Amazon CloudWatch Agent logs, I see the following errors:
configuration-validation.log
2023-12-06T21:51:59Z E! The service process could not connect to the service controller.
amazon-cloudwatch-agent.log
2023-12-07T16:24:07Z E! cloudwatch: WriteToCloudWatch failure, err: RequestError: send request failed
caused by: Post "https://monitoring.sa-east-1.amazonaws.com/": dial tcp 172.30.1.233:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
2023-12-07T16:28:32Z E! cloudwatch: code: RequestError, message: send request failed, original error: Post "https://monitoring.sa-east-1.amazonaws.com/": dial tcp 172.30.1.233:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I did what this documentation (https://repost.aws/pt/knowledge-center/cloudwatch-unified-agent-metrics-issues) instructed and this was the result:
C:\Users\brlink>nslookup monitoring.sa-east-1.amazonaws.com
Server: ip-172-30-0-2.sa-east-1.compute.internal
Address: 172.30.0.2
Non-authoritative answer:
Name: monitoring.sa-east-1.amazonaws.com
Address: 172.30.1.233
C:\Users\brlink>netstat -nr
===========================================================================
Interface List
5...02 cf 2c 89 3a 72 ......Amazon Elastic Network Adapter #2
1...........................Software Loopback Interface 1
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 172.30.1.1 172.30.1.22 15
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
172.30.1.0 255.255.255.0 On-link 172.30.1.22 271
172.30.1.22 255.255.255.255 On-link 172.30.1.22 271
172.30.1.255 255.255.255.255 On-link 172.30.1.22 271
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 172.30.1.22 271
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 172.30.1.22 271
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
169.254.169.254 255.255.255.255 172.30.1.1 15
169.254.169.250 255.255.255.255 172.30.1.1 15
169.254.169.251 255.255.255.255 172.30.1.1 15
169.254.169.249 255.255.255.255 172.30.1.1 15
169.254.169.123 255.255.255.255 172.30.1.1 15
169.254.169.253 255.255.255.255 172.30.1.1 15
===========================================================================
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
1 331 ::1/128 On-link
1 331 ff00::/8 On-link
===========================================================================
Persistent Routes:
None
I don't know what to do or how to proceed. Could you shed some light? If you need any more information, I am at your disposal. Thank you in advance for your help.
I was going to ask the same question here.
Hello everybody. I did the basics, restarted the instance and the agent started working again. I had not done this before, as the client did not have the window to carry out this maintenance. I appreciate everyone's availability.