2

Recently, I've been investigating how to setup CloudWatch Monitoring in our AWS instances to include Mem Util and Disk Util.

I've followed this guide. It worked like a charm.

I have everything working on our Production-REF (Reference) box. I create an Image, and add it to our Launch Configuration for our AutoScaleGroup. Everything deploys fine, and all the scripts run.

The Problem: The instance-id is cached on the AutoScale boxes, so it sends all information back as the Production-REF box.

I don't really want to tweak the out of the box AWS script, but I see in CloudWatchClient.pm it calls get_instance_id, which calls get_meta_data, which uses cache [ http://169.254.169.254/latest/meta-data ].

Anyway to clear http://169.254.169.254/latest/meta-data cache? Preferably just the first time its called on that instance. Maybe another way?

Any help is appreciated!

Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203
Dan
  • 81
  • 4
  • That value should not be cached. It should be unique for every instance. Its not provided by the image, instead its generated by the hypervisor control system. – datasage Mar 06 '15 at 16:36

1 Answers1

3

I found the cached file: /var/tmp/aws-mon/instance-id

If you remove that, it'll auto replace it with the correct (AutoScaled Box's Instance Id).

Dan
  • 81
  • 4