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

查看:127
本文介绍了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?

推荐答案

I在找东西时可以帮助我禁用机器的警报,该机器每星期六在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天全站免登陆