我们使用
mon-get-instance-stats.pl
向Cloudwatch发送自定义指标(RAM和磁盘使用率)。
我设置了这个
following the AWS documentation
。我们使用实例角色赋予实例调用CloudWatch的权利,我们不使用访问密钥。
这对我们的爱尔兰(eu-west-1)实例来说很有吸引力,但对我们的法兰克福(eu-central-1)实例来说失败了,在那里我得到了以下错误消息:
$ /home/ec2-user/aws-scripts-mon/mon-put-instance-data.pl --mem-util --mem-used --mem-avail --swap-util --swap-used --disk-path=/ --disk-space-util --disk-space-used --disk-space-avail --aws-iam-role=instancerole
ERROR: Failed to call CloudWatch: HTTP 403. Message: The security token included in the request is invalid
For more information, run 'mon-put-instance-data.pl --help'
请注意,角色
instancerole
在爱尔兰和法兰克福的EC2实例上正确配置。
我能做什么来解决这个问题?