LoginSignup
0
3

More than 5 years have passed since last update.

AWS EC2でCloudWatch用にメモリ使用率を取得しようとして躓いたメモ

Posted at

ここを見てやってみたけど、IAM無いよって言われて悩んだ。
OS: CentOS7

ERROR: No IAM role is associated with this EC2 instance.

awscreds.template 変更したのにおかしいなと思ったけど、これはテンプレートで、
実際に使う場合は awscreds.conf のファイル名で作らないといけないみたい。

CloudWatchClient.pm
  if (!$aws_credential_file) {
    my $conf_file = &File::Basename::dirname($0) . '/awscreds.conf' ;
    if (-e $conf_file) {
      $aws_credential_file = $conf_file;
    }
  }

なので、以下のようにしてコピーしてあげれば動く。

cp awscreds.template awscreds.conf

ちなみに、設定ファイルを使わないなら --aws-access-key-id--aws-secret-key を指定してあげても動く。

./mon-put-instance-data.pl --mem-util --verify --verbose --aws-access-key-id アクセスキー --aws-secret-key シークレットキー
0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3