簡體   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