正如杰罗姆所说, 您还需要添加一个stream程pipe理器; 例如Monit或Supervisor。 这是因为Docker会监视一个进程。 如果你需要多个进程,你需要在顶层添加一个来照顾其他进程。 换句话说,你正在把一个精简而简单的容器变成更加复杂的东西。 我不清楚为什么你需要一个容器内的进程pipe理器。 那么有人可以向我解释一下,在一个容器内部有一个stream程pipe理器有什么好处? 让systemd或新贵来处理stream程,而不是为你的容器增加额外的服务不是更好吗?
我有一个自定义的服务,我想监视monit。 当进程失败时,我想将日志复制到共享文件系统并重新启动服务。 像下面的东西,但我不知道是什么。 任何提示,将不胜感激。 check process pipeline with pidfile /var/run/pipeline.pid start program = "/sbin/start pipeline" stop program = "/sbin/stop pipeline" if 10 restarts within 10 cycles then timeout # Not sure what to write next if <service has failed> restart and exec "/bin/bash -c 'cp /var/log/upstart/pipeline.log /nfs/logs/`hostname`.`date +'%m-%d-%Y_%H.%M.%S'`.log'"
我正在尝试使用monit,并使用gmail设置电子邮件服务器。 configuration文件是这样的: set mailserver smtp.gmail.com port 587 username "[email protected]" password "password" using tlsv1 with timeout 30 seconds 我设置了一个警报来testing: check file alerttest with path /.nonexistent alert [email protected] with reminder on 500 cycles 但是当我使用monitvalidation时,我得到的错误信息是这样的: Sendmail: error receiving data from the mailserver 'smtp.gmail.com' — Resource temporarily unavailable Alert handler failed, retry scheduled for next cycle 'alerttest' file doesn't […]
我想让Monit检查一个Web应用程序的健康状况,频繁地运行廉价/平凡的检查以及不经常检查(例如1/5分钟)的昂贵/不重要的检查。 我怎么能告诉它检查一个给定的主机比每个监视间隔更频繁?
我正在尝试使用404或403页面监视HTTP状态。 大家都知道Monit把这些页面当作失败的连接,但是我怎么能改变这个页面。 我只想监视它显示404或403页面。 如果可能的话,我需要用这个configuration来检查它。 这是我的检查configuration: check process httpd with pidfile /var/run/httpd.pid start program = "/etc/init.d/httpd start" stop program = "/etc/init.d/httpd stop" if failed host hostname port 80 protocol HTTP request "/" then exec "/bin/bash -c '/bin/echo -e "hostname\thttpd\t3\tFAILED" | /usr/sbin/send_nsca -H nagiosserver -c /etc/send_nsca.cfg; /usr/bin/monit restart nginx;'"
Monit似乎放弃了重启服务,如果它几次失败,并取消它的监视。 在关于何时或为什么的细节的文档中,我找不到任何东西。 我的Monitconfiguration设置如下: set daemon 10 set logfile /var/log/monit.log set statefile /var/lib/monit/monit.state set alert [email protected] 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 在我的环境中,我希望它无限期地继续尝试其轮询间隔。 有没有什么办法可以configuration监控, 永不停止监控服务,即使它不能成功启动?
我刚刚根据monit文档安装并configuration了monit 。 除Apache以外的所有服务均列为“正在运行”,但Apache说“ 未监控” 。 monitconfiguration中的相关行是: check process apache with pidfile /var/run/httpd.pid group www start program = "/etc/init.d/httpd start" stop program = "/etc/init.d/httpd stop" if failed host localhost port 80 protocol http then restart if 5 restarts within 5 cycles then timeout 我可以从服务器访问http:// localhost / server-status和http:// localhost 。 Monit将Apache的监视模式列为活动状态 。 服务器正在运行CentOS 5.4。 PID文件对于父httpd服务器是正确的: [server ~]$ […]
我正在设置monit,并希望监视给定的python应用程序。 Monit通过查看进程的.pid文件来做到这一点,但是我不知道这会是什么。 我也尝试创build我自己的简单的可执行文件,并运行它 – 我也无法弄清.pid文件的创build位置。 并且所有进程都有一个.pid文件吗?
每当monit守护进程停止或启动时,Monit都会发出警报。 这是令人讨厌的,没有用的信息。 根据文件,我设定: set alert [email protected] but not on { instance } …应该向该电子邮件发送警报,除非它们位于“实例”类别(定义为启动/停止)。 不过,我仍然会收到警报。 这是超级烦人的。 显然我一定会错过一些东西。 我们正在运行Monit 5.2.4
我需要监视在我的web服务器上运行的几个进程。 由于某种原因,清漆现在每天都会崩溃一两次。 我正在使用monit来自动重新启动清漆,但它不起作用。 这是我的用于Varnish的monit.conf条目。 check process varnish with pidfile /var/run/varnish.pid start program = "/etc/init.d/varnish start" with timeout 60 seconds stop program = "/etc/init.d/varnish stop" if failed host <my server ip> port 80 protocol http and request "/blank.html" then restart if 3 restarts within 5 cycles then timeout group server 日志文件显示清漆停止运行后,尝试重新启动后都失败。 然后最后监视清漆。 任何人都有如何解决这个问题的build议? 或者更好的是,你可以build议其他简单的方法来自动监视和重新启动崩溃的进程? 谢谢!