是否有可能configurationmonit周期性地重新启动应用程序? 我正在使用monit来检查应用程序运行状况,如果它已经monit ,请重新启动它。 我也想定期重新启动它。 倾向于与monit做,而不是单独做一个cron工作。
我的ubuntu 6.06 LTS服务器上有apache 2.2的问题,一些旧的rails网站正在生成seg错误和各种各样的疯狂似乎最终拖动apache。 我将它们迁移到8.04安装与nginx和乘客,在那里的错误已被压扁 – 但这需要时间,直到那时我已经尝试设置监控,以解救阿帕奇每当它停止响应: if failed host www.site.com port 80 protocol http and request "/" with timeout 5 seconds for 2 cycles then restart 50%的时间,重新启动apache成功并节省了一天,但另一半的时间apache死亡和monit什么都不做。 当我检查监视状态时,在这里显示一个-1的响应时间: port response time 0.061s to www.site.com:80/ [HTTP via TCP] 那里0.061s将是-1。 我似乎无法find解释-1的任何文档,或者为什么-1似乎由于失败的陈述而滑落。 有什么我可以做的,以确保monit捕获100%的失败? 或者任何人都可以阐明-1以及如何处理它?
我试图用monit来监视一个backgroundrb进程(偶尔会被杀死),但是我似乎无法看到启动或停止命令的工作(我简单地得到'执行失败') – 虽然他们在命令中工作正常提示。 我没有做任何特别复杂的事情: check process backgroundrb_11006 with pidfile "/home/user/site/tmp/pids/backgroundrb_11006.pid" start = "/usr/bin/ruby /home/user/site/script/backgroundrb start" stop = "/usr/bin/ruby /home/user/site/script/backgroundrb stop" if cpu > 90% for 2 cycles then restart if totalmem > 512 MB for 2 cycles then restart if 4 restarts within 4 cycles then timeout group backgroundrb 我有一个自定义的位置,像我的一些gem像包(/home/user/.gem/ruby/1.8/bin),我怀疑部分问题是,monit使用斯巴达PATH(引用http:/ / /mmonit.com/monit/documentation/monit.html – PATH = […]
给定一个像这样的configuration: check host web1 address web1 if failed host web1 port 80 protocol http then exec "/usr/local/bin/failover.sh -h web2" 我可以检测web1是否从失败状态返回,并执行“故障恢复”操作? 如果我只是想检测它是否已经启动,那么我将在每个守护进程中运行故障转移命令,如果不需要,我不想这样做。 它会提供不必要的日志条目和警报。
我想监视我的服务,一旦停止,然后我想要电脑重新启动。 这个过程没有一个我可以监控的端口。 这就是我所做的: check process chat with pidfile /var/run/chat.pid start program = "/etc/init.d/chat start" stop program = "/etc/init.d/chat stop" if changed ppid then exec /sbin/reboot 我尝试了所有的东西,但只是重新启动我的服务。 任何build议。
我有几个进程在服务器上运行,具有monit监视的不同angular色。 例如,说我有一个Apache服务器和一个数据库服务器与MySQL。 我有几个monitrc文件可以放入monit的configuration目录来监视这些进程。 厨师的最优雅的方式是什么,以确保适当的文件进入监控configuration目录,基于angular色? 我看到的选项: 在监视节点angular色的监视菜单中使用模板资源,看它是否应该执行 在apache和mysql食谱中使用一个模板资源(但检查是否安装了monit) 在每个angular色的monit cookbook中创build单独的收件人,并将其添加到angular色的运行列表(monit :: mysql,monit :: apache等) 我真正想做的是把代码确保文件移动到angular色的文件中,但是我不认为这是可能的。 想法?
我正在运行Apache,并试图监视它与Monit。 监控似乎工作正常,但是当Apache停机时,Monit没有成功启动它。 Monit检测到它已closures,但启动命令失败。 下面是monitconfiguration check process httpd with pidfile /var/run/httpd.pid start program = "/usr/bin/apachestart start" stop program = "/etc/init.d/httpd stop" if failed host 127.0.0.1 port 80 protocol http then restart if 5 restarts within 5 cycles then timeout 这是指Apache的启动脚本,其中包括以下内容: # cat /usr/bin/apachestart ## start Apache with default settings ulimit -l 256; ulimit -s 56000; /usr/sbin/apachectl […]
我想监督我的Rails应用程序与monit独angular兽运行。 以root用户身份login后,从shell运行下列两行将会失败: "/srv/app/current/config/unicorn.sh start" su -c "/srv/app/current/config/unicorn.sh start" app 什么工作是: su -c "/srv/app/current/config/unicorn.sh start" – app 它并不让我惊讶,我使用rbenv ,它需要在$PATH进行一些修改,我在.bash_profile做了一些修改。 不幸的是,我不能让它与monit一起工作。 我准备了一些基于我在互联网上发现的脚本: check process unicorn with pidfile /srv/app/shared/pids/unicorn.pid start program = "/srv/app/current/config/unicorn.sh start" as uid app and gid app stop program = "/srv/app/current/config/unicorn.sh stop" as uid app and gid app group www 它看起来像.bash_profile不读在这种情况下 – 如何改变它? 或者,或者,如何添加几个目录到monit使用的$PATH ? […]
我configuration了monit来检查我的服务,而且我正在检查其中一个服务是否仍然健全。 如果这个服务不能正常工作,我会想要重启所有我正在监控的服务(因为它们之间的依赖关系)。 目前我把所有的服务都放在一个组里,所以我可以写 if failed MY_TEST exec "/usr/sbin/monit -g MY_GROUP restart" 我想做的事情是这样的: if failed MY_TEST restart group MY_GROUP 是否有任何行动,我可以采取内部做到这一点(即没有从monit调用monit)?
我有一个非常低的stream量Nginx框,作为外部服务的反向代理。 如果它崩溃,我有Monit的框重新启动nginx 。 不用说, nginx每天至less在这台机器上停一次, monit不得不重启它。 这是我的monitconfiguration: check process nginx with pidfile /var/run/nginx.pid start program = "/etc/init.d/nginx start" stop program = "/etc/init.d/nginx stop" if cpu > 60% for 2 cycles then alert if cpu > 80% for 25 cycles then restart if totalmem > 400.0 MB for 5 cycles then restart if children > 250 […]