繁体   English   中英

monit 何时实际启动或重新启动服务

[英]When will monit actually start or restart a service

有人可以让我知道 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/这样的东西

有人可以帮我吗?

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

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

 if failed
    port 80
    protocol http
    request "/data/show?a=b&c=d"
 then restart

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM