简体   繁体   中英

AWS Cloudwatch Monitoring - Migrated the EC2 server in another region

I was using the cloud watch monitoring script (aws-scripts-mon) and it was working fine. but I recently migrated my server to a different region (from Singapore to Mumbai).

now ec2 server is pushing the data to the previous region, even I have changed the default region to Mumbai.

while running this command./mon-put-instance-data.pl --mem-util --verify --verbose, it shows an endpoint that is of the Singapore region.

No credential methods are specified. Trying default IAM role. Using IAM role

Endpoint: https://monitoring.**ap-southeast-1**.amazonaws.com
Payload: {"MetricData":[{".......................................

How can I change this endpoint?

Thank you.

From the AWS doc .

Troubleshoot

The CloudWatchClient.pm module caches instance metadata locally. If you create an AMI from an instance where you have run the monitoring scripts, any instances launched from the AMI within the cache TTL (default: six hours, 24 hours for Auto Scaling groups) emit metrics using the instance ID of the original instance. After the cache TTL time period passes, the script retrieves fresh data and the monitoring scripts use the instance ID of the current instance. To immediately correct this, remove the cached data using the following command:

rm /var/tmp/aws-mon/instance-id

Remove the cache or wait six hours.

Also the CloudWatch monitoring script is deprecated. Better to use CloudWatch agent instead of script for collecting the logs and metrics.

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