處於「警報」狀態的 AWS 警報不會觸發策略操作

處於「警報」狀態的 AWS 警報不會觸發策略操作

今天,我建立了一個包含多個策略的 AutoScaling 群組,每個策略都有一個與 CloudWatch 指標關聯的警報。 AutoScaling 群組啟動了兩個實例,因為這是我對該群組所需的最低限度。我打開基準測試來攻擊新組,他們的綜合平均 CPU 使用率上升到我為警報設定的閾值之上。我觀察了每個警報的歷史記錄,狀態從 INSUFFICIENT_DATA 變為“正常”,最後變為“警報”。正如預期的那樣。然後我就等待政策的執行。執行前指定的 300 秒來了又去。然後我決定看看政策執行需要多長時間。現在已經過去一個半小時​​了,這些政策尚未執行。

我很沮喪,刪除了 ASG 以及所有策略和警報。我認為我在創建策略和警報時可能犯了一個錯誤。所以我重新創建了它們。同樣的問題。警報處於警報狀態並且從不執行策略。我可以毫無問題地手動執行策略,但這違背了要點。

如果有什麼區別的話,我在 AWS 控制台中建立了所有這些內容。過去,我使用 API 來建立 ASG 和策略,這些群組可以很好地執行策略。

我做錯了什麼嗎? (或者也許 AWS 服務只是有問題。)

更新:

今天又嘗試了這個。決定使用 API 而不是控制台來看看是否有任何差異。我使用的鬧鐘在 20 分鐘前剛從 OK 更新為 ALARM。

CPUUtilization >= 35 for 5 minutes
Actions: In ALARM: For group TEST use policy Scale Out API (Add 1 instance)
Namespace: AWS/EC2
Metric Name: CPUUtilization
Dimensions: AutoScalingGroupName = TEST
Statistic: Average
Period: 5 minutes

2013-12-19 15:13 UTC-7 - 狀態更新 - 警報從 OK 更新為 ALARM

目前時間:15:43 UTC-7(警報後 30 分鐘)

行動尚未觸發。知道為什麼嗎?

答案1

我在上問了這個問題亞馬遜論壇顯然,最近建立警報時存在一個錯誤,該錯誤會自動將「ActionsEnabled」屬性設為 False。

來自 AWS:

We have identified an issue in the AutoScaling console regarding the binding of
AutoScaling policies to CloudWatch alarms and are working on a fix. We will post
an update to this thread once the fix is rolled out. Thanks for bringing this to
our attention.

目前解決方法:

In the meantime, please try calling the DescribeAlarms CloudWatch API. If the
alarms associated with your policies have ActionsEnabled=false, then this could
cause your policies to not be invoked when the alarm is triggered. Please try
calling the PutMetricAlarm CloudWatch API to update ActionsEnabled=true for the
affected alarms, and that should fix the issues you are experiencing.

我已經透過 API 使用我自己的警報確認了該錯誤和解決方法。

相關內容