I recently had to recreate images for our production systems on EC2 because they didn’t have ephemeral storage that we require to keep our temporary tcp dumps. Considering that they are EC2 instances, it was quite easy.
We use mon-get-instance-stats.pl to monitor system metrics such as memory utilization and disk space.
Naturally, I copied alarms from the old instances and just replaced the InstanceId with the new ones. However, I was baffled to see CloudWatch complaining that the alarms has INSUFFICIENT_DATA. Attempting to verify,
mon-get-instance-stats.pl --verify showed the wrong InstanceId.
It wasn’t after I ransacked the whole filesystem I realized that the Perl scripts are caching information in
/var/tmp/aws-mon. Remove (or move) that directory and all is well again.
I hope this saves someone some time.