[英]When will monit actually start or restart a service
Can someone please let me know on what basis monit decides that its time to restart an application?有人可以让我知道 monit 决定重启应用程序的时间是什么吗? For instance, if I want monit to monitor my web application, what information should I provide to monit based on which it will restart?
例如,如果我想让 monit 监控我的 web 应用程序,我应该向 monit 提供哪些信息以使其重新启动?
thanks谢谢
Update: I was able to kind of make it work using the following monit config更新:我能够使用以下监视器配置使其工作
check host altamides with address web.dev1.ams
if failed port 80 with protocol http
then alert
However, I was wondering if I can use any absolute URL of my application.但是,我想知道我是否可以使用我的应用程序的任何绝对 URL。 Something like
http://foo:5453/test/url/1.html/
像
http://foo:5453/test/url/1.html/
这样的东西
Can someone help me on that please?有人可以帮我吗?
Monit by himself will not restart any service, but you can provide to it the rules you want to perform it, you can do something like 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
I figured the answer from monit help page我从监视器帮助页面中找到了答案
if failed
port 80
protocol http
request "/data/show?a=b&c=d"
then restart
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.