LoginSignup
1
0

More than 3 years have passed since last update.

awscliでCPU使用率80%以上になったらアラートを上げる設定を入れる

Posted at

準備

対象のEC2インスタンスIDを取得
連携対象のSNSのarnを取得
コンソール画面上から見てもOK

オプションいっぱいのコマンド

aws cloudwatch put-metric-alarm --alarm-name "CPUUtilization80%" --namespace AWS/EC2 \
--metric-name CPUUtilization --dimensions "Name=InstanceId,Value=i-0219028c30d71bee2" --period 300 \
--statistic Average --threshold 80 --comparison-operator GreaterThanOrEqualToThreshold \
--evaluation-periods 1 --alarm-actions arn:aws:sns:ap-northeast-1:697333814928:Default_CloudWatch_Alarms_Topic  \
--ok-actions arn:aws:sns:ap-northeast-1:697333814928:Default_CloudWatch_Alarms_Topic 

image.png

参考

1
0
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
1
0