CloudWatch Agent ec2metadata not available

0

I have 3 EC2 instances which do not have a public IP address and are connected via a VPN to a private network. I have installed the CloudWatch agent on them. When I try to start them using the following command:

$ sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s

I receive the following error:
ec2metadata is not available
I! detect region from ecs
Unable to determine aws-region.
Please check if you can access the metadata service. For exampe, on linux, run 'wget -q -O - http://169.254.169.254/latest/meta-data/instance-id && echo'
Fail to fetch the config!

When I try to run the specified wget command I get a 503 Service Unavailable error.

I am at a loss for how to troubleshoot this further. Is there a way to specify the Region in the config files for the agent?

mhatch1
gefragt vor 3 Jahren2331 Aufrufe
1 Antwort
0

Hello,

thank you for sending this message.

it's possible that this might be a metadata issue and not a region issue. I see that you are using VPN, so I suspect this instances needs to get access to ec2 endpoints.

Here is link that might be helpful : This should help https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html#CloudWatch-Agent-Configuration-File-Metricssection

Get back to us if you need anything.

beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen