我想在特定时间段内自动打开/关闭警报,这样它们就不会在维护窗口期间触发.我怀疑是否存在简单或直接的方法,因为我在文档中找不到这样的东西.有谁知道在仍然使用 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 警报?
发布评论