Help us understand the problem. What is going on with this article?

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

準備

EC2からディスク使用率を送る設定を入れておく

awscliで実行

カスタムメトリクスなので、--namespace System/Linuxになります。
--dimensionsオプションに複数パラメータを付ける必要がある。この場合、スペース区切りでパラメータを追加する。("で囲わない)

aws cloudwatch put-metric-alarm --alarm-name "DiskSpaceUtilization80%" --namespace System/Linux \
--metric-name DiskSpaceUtilization --dimensions Name=InstanceId,Value=i-0219028c30d71bee2 Name=MountPath,Value=/ Name=Filesystem,Value=/dev/xvda1 --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

動作確認用メモ

6GBのファイルを作成

dd if=/dev/zero of=6G.dummy bs=6M count=1000
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away