0

有人可以让我知道 monit 决定重启应用程序的时间是什么吗?例如,如果我想让 monit 监控我的 Web 应用程序,我应该向 monit 提供哪些信息,然后它将根据哪些信息重新启动?

谢谢

更新:我能够使用以下监视器配置使其工作

check host altamides with address web.dev1.ams
if failed port 80 with protocol http
      then alert

但是,我想知道是否可以使用我的应用程序的任何绝对 URL。就像是http://foo:5453/test/url/1.html/

有人可以帮我吗?

4

2 回答 2

1

Monit 自己不会重新启动任何服务,但您可以向它提供您想要执行它的规则,您可以执行类似的操作

check process couchdb with pidfile /usr/local/var/run/couchdb/couchdb.pid
    start program = "/etc/init.d/couchdb start"
    stop program  = "/etc/init.d/couchdb stop"
    if cpu > 60% for 2 cycles then alert
    if cpu > 80% for 5 cycles then restart
    if memory usage > 70% MB for 5 cycles then restart

check host mmonit.com with address mmonit.com
      if failed port 80 protocol http then alert
      if failed port 443 protocol https then alert
于 2021-06-09T03:53:23.363 回答
0

我从监视器帮助页面中找到了答案

 if failed
    port 80
    protocol http
    request "/data/show?a=b&c=d"
 then restart
于 2021-06-10T03:26:40.623 回答