使用monit监控工具设置Delayed_job

发布于 2024-12-22 22:24:34 字数 174 浏览 3 评论 0原文

我正在部署 Rubyonrails Web 应用程序,其中包含 ruby​​ 1.9.2p280、rubyonrails 3.07,其中包含 apache乘客和delayed_job作为后台作业。

我想监控我的乘客以及delayed_job后台作业。

我找不到任何分步指南。

非常感谢你

I am deploying Rubyonrails web app with ruby 1.9.2p280, rubyonrails 3.07 with apache passenger and delayed_job as background job.

I would like to monitor my passenger as well as delayed_job background job.

I could not find any step by step guide.

Thanks you very much

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情丝乱 2024-12-29 22:24:35

如下所述添加以下 .monitrc 文件并运行命令 monit reload 加载配置。

/etc/monit/web.monitrc

check process apache with pidfile /var/run/apache2.pid
  start program = "/etc/init.d/apache2 start"
  stop program  = "/etc/init.d/apache2 stop"
  if cpu > 80% for 5 cycles then restart
  if totalmem > 300.0 MB for 5 cycles then restart
  if children > 250 then alert
  if failed port 80 with timeout 10 seconds then restart
  if 3 restarts within 5 cycles then timeout
  mode manual
  group web

/etc/monit/delayed_job.monitrc

check process delayed_job with pidfile /mnt/<project>/tmp/pids/delayed_job.pid
  start program = "/usr/bin/delayed_job_start"
  stop program = "/usr/bin/delayed_job_stop"
  mode manual
  group delayed_job

/usr/bin/delayed_job_start

#!/bin/sh

cd /mnt/<project> && RAILS_ENV=production ruby script/delayed_job start

Add the following .monitrc files as mention below and run the command monit reload to load the configuration.

/etc/monit/web.monitrc

check process apache with pidfile /var/run/apache2.pid
  start program = "/etc/init.d/apache2 start"
  stop program  = "/etc/init.d/apache2 stop"
  if cpu > 80% for 5 cycles then restart
  if totalmem > 300.0 MB for 5 cycles then restart
  if children > 250 then alert
  if failed port 80 with timeout 10 seconds then restart
  if 3 restarts within 5 cycles then timeout
  mode manual
  group web

/etc/monit/delayed_job.monitrc

check process delayed_job with pidfile /mnt/<project>/tmp/pids/delayed_job.pid
  start program = "/usr/bin/delayed_job_start"
  stop program = "/usr/bin/delayed_job_stop"
  mode manual
  group delayed_job

/usr/bin/delayed_job_start

#!/bin/sh

cd /mnt/<project> && RAILS_ENV=production ruby script/delayed_job start
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文