能否在特定时间暂停/禁用 AWS CloudWatch 警报? [英] Can AWS CloudWatch alarms be paused/disabled during specific hours?

查看:45
本文介绍了能否在特定时间暂停/禁用 AWS CloudWatch 警报?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在特定时间段内自动打开/关闭警报,这样它们就不会在维护窗口期间触发.我怀疑是否存在简单或直接的方法,因为我在文档中找不到这样的东西.有谁知道在仍然使用 CloudWatch 警报的同时实现这一目标的不同方法,还是我错过了一个明显的解决方案?

I want to automatically toggle alarms on/off during specific periods of time so that they do not fire during maintenance windows. I'm doubting that an easy or direct method exists since I could not find such a thing in the documentation. Does anyone know of a different approach to achieve this while still using CloudWatch alarms, or did I miss an obvious solution?

推荐答案

我来到这里是为了寻找可以帮助我禁用每周六 11:00 到 11:30 之间执行备份的机器的警报的东西.我找到的唯一解决方案是创建 cronjob 来禁用/启用特定警报并在特定时间运行它们:

I got here while looking for something that would help me to disable alerts for my machine which is performing backups every Saturday between 11:00 and 11:30. The only solution I found is to create cronjob to disable/enable particular alert and run them on particular times:

59 10 * * 6 ec2-user aws cloudwatch disable-alarm-actions --alarm-names "Alarm-1" "Alarm-2"
31 11 * * 6 ec2-user aws cloudwatch disable-alarm-actions --alarm-names "Alarm-1" "Alarm-2"

显然,您的节点需要有权访问 CloudWatch.我给了它 CloudWatchFullAccess.

Your node needs to have access to CloudWatch, obviously. I gave it CloudWatchFullAccess.

这篇关于能否在特定时间暂停/禁用 AWS CloudWatch 警报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆