加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 可以将Monit配置为永不取消监控/超时服务吗?

发布时间:2020-12-13 17:56:31 所属栏目:Linux 来源:网络整理
导读:Monit似乎放弃重启服务,如果它失败几次,并取消监控它.我在文档中找不到有关何时或为何具体的细节. 我的Monit配置将设置如下: set daemon 10set logfile /var/log/monit.logset statefile /var/lib/monit/monit.stateset alert foo@example.com not { nonexi
Monit似乎放弃重启服务,如果它失败几次,并取消监控它.我在文档中找不到有关何时或为何具体的细节.

我的Monit配置将设置如下:

set daemon 10
set logfile /var/log/monit.log
set statefile /var/lib/monit/monit.state
set alert foo@example.com not { nonexist,action,instance }
include /etc/monit/conf.d/*

这是我使用的Monit规则集的一个例子:

check process myservice
  with pidfile /var/run/myservice/myservice.pid
  start program = "/home/myservice/current/start-myservice.sh"
    as uid myservice and gid myservice
  stop program = "/home/myservice/current/stop-myservice.sh"
    as uid myservice and gid myservice
  mode active

在我的环境中,我希望它能无限期地继续尝试它的轮询间隔.有没有办法配置monit永远不会停止监视服务,即使它没有成功启动?

解决方法

我只想使用一个cron作业,它将以所需的间隔运行monit start servicename.当然,您可以使用组进行更精细的控制.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读