在 Linux 中最多发送一次 monit 警报?

在 Linux 中最多发送一次 monit 警报?

我的发送短信的脚本

#send-sms.sh 
curl "http://10.10.10.10:1084/somerandomhexcode&[email protected]&password=passwordgOesHere&countryCode=countrycodegoeshere&mobileNumber=%2bphone_number_with_country_code_goes_here&message=message_goes_here"

我已经独立测试了这个脚本并且它成功发送了短信。

我的 monit 配置用于检查某个 glassfish 域是否已关闭:

check host DOMAIN_I_WANT_TO_CHECK with address 127.0.0.1
  if failed port 10080 then exec "/root/send-sms.sh"

send-sms.sh可以用chmod 777.

想象这样一个场景:服务器在晚上 11 点到凌晨 5 点之间出现故障,并且警报每 60 秒发出一次。这将是一场绝对的噩梦。我该如何避免此类情况?

相关内容