简体   繁体   English

CloudWatch 警报操作仅触发一次 SNS

[英]CloudWatch alarm action only triggers SNS once

I have a CloudWatch alarm created for testing purposes.我创建了一个用于测试目的的 CloudWatch 警报。 It checks the number of bytes read on a Kinesis Stream.它检查在 Kinesis Stream 上读取的字节数。 If less than 1 bytes are received within 1 minute, it triggers alarm and send email via SNS.如果在 1 分钟内收到少于 1 个字节,则触发警报并通过 SNS 发送电子邮件。 So, I get email after 1 min, but then after that I don't get any further email.所以,我在 1 分钟后收到电子邮件,但在那之后我没有收到任何进一步的电子邮件。 Is it right the email notification sent only once?仅发送一次电子邮件通知是否正确? In my test data is not flowing all the time.在我的测试中,数据并不是一直在流动。 So, ideally, it should send email every minute.因此,理想情况下,它应该每分钟发送一次电子邮件。 Correct?正确的?

If CloudWatch alarm switched to ALARM state after specified period (1 minute), then in your case it means it received less than 1 byte.如果 CloudWatch 警报在指定时间段(1 分钟)后切换到ALARM状态,则在您的情况下,这意味着它收到的数据少于 1 个字节。 When switched, it will trigger configured actions (in your case it is email notification).切换时,它将触发配置的操作(在您的情况下是电子邮件通知)。 As long as alarm remains in the ALARM state without switching it state back to OK , nothing will be triggered again.只要警报保持在ALARM状态而不将其状态切换回OK ,则不会再次触发任何内容。

if alarm returned back to OK state and then again after the specified period it switched to ALARM , configured action will be triggered again.如果警报返回到OK状态,然后在指定的时间段后再次切换到ALARM ,则将再次触发配置的动作。

For more information, refer to documentation .有关更多信息,请参阅文档

Whether or not the action keeps firing depends on the type of action .动作是否持续触发取决于动作的类型

SNS actions only trigger once when the state changes to ALARM . SNS 操作仅在状态更改为ALARM时触发一次 Other actions such as EC2 auto scaling keep triggering as long as the alarm is in ALARM state.只要警报处于ALARM状态,其他操作(例如 EC2 自动缩放)就会一直触发。

If your alarm reverts to OK state and then back again to ALARM , SNS will get triggered again.如果您的闹钟恢复到OK状态,然后又恢复到ALARM ,则 SNS 将再次被触发。

AWS docs AWS 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM