1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【CloudWatch】ダウンタイム設定

Posted at

前置き

AWS環境をCloudWatchで監視しているが、特定のサーバはcronやタスクスケジューラなどで定期的にプロセス再起動やサーバ再起動していて、その時間帯だけはダウンタイム(監視抑止)の設定をしたいと思いました。
以前に勤めていた会社ではMackerelというsaasの監視ツールを導入していて、簡単にダウンタイム設定をすることができました。
CloudWatchでもMath関数を用いて、同様のことができたので、以下に備忘として記載します。

CloudWatchでの設定方法

①[CloudWatch]-[アラーム]からダウンタイムを設定したいアラームを選択します。
image.png
②次に、メトリクスの[編集]を押下し、[数式を追加]-[すべての関数]-[IF]を選択します。
ここでID「m1」がもともとの監視定義で、新しく追加された行がもともとの監視定義「m1」に対する条件(今回は〇〇の間は、監視を無効)を定義します。

例)日本時間8時~8時45分の間は、ダウンタイム(監視抑止)したい場合
IF( (HOUR(m1) == 23 AND MINUTE(m1) >= 0 AND MINUTE(m1) <= 45), 1, m1 )
CloudWatchの時間はUTC表記なので、上記のように記述する必要があります。
上記のように記述することで、UTC23時から23時45分までの間は、監視定義「m1」の値を「1」にするという意味になります。

image.png

今回ダウンタイム設定したCloudWatchアラームについては、以下のような閾値のため、ダウンタイムを設定したい時間帯を「1」にすることで、その時間はアラート発報しないという意味になります。
image.png

参考URL

IF 式の使用 | CloudWatch メトリクスでの数式の使用
https://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/monitoring/using-metric-math.html#using-IF-expressions

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?