使用AMI克隆EC2实例(更改主机安全组)后,Amazon提供的mon-put-instance-data.pl脚本所报告的统计信息都不会在CloudWatch中显示。
我可以确认该脚本正在将数据报告给CloudWatch,但它并未显示在CloudWatch控制台中:
# ./mon-put-instance-data.pl --aws-credential-file=/root/.aws-credentials --mem-util --disk-space-util --disk-path=/ --swap-util Successfully reported metrics to CloudWatch. Reference Id: xxxxxxxx-xxxx-xxxx-xxxx-93f25b4efbc7
通过strace找出它。 当前实例IDcaching在/ var / tmp / aws-mon中,并且通过AMI进程保存了不正确的caching。
解决scheme:
# mv /var/tmp/aws-mon /var/tmp/aws-mon.bak