monitoring multiple delayed job workers with monit

送分小仙女□ 提交于 2019-12-04 05:18:06

You can just replicate the same config you have for the first worker N times. Suppose you have 5 workers, you'll monitor all of them with the following:

check process delayed_job.0
   with pidfile /path/to/shared/pids/delayed_job.0.pid
   start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user"
   stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user"

check process delayed_job.1
   with pidfile /path/to/shared/pids/delayed_job.1.pid
   start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user"
   stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user"

check process delayed_job.2
  with pidfile /path/to/shared/pids/delayed_job.2.pid
  start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user"
  stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user"

check process delayed_job.3
  with pidfile /path/to/shared/pids/delayed_job.3.pid
  start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user"
  stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user"

check process delayed_job.4
  with pidfile /path/to/shared/pids/delayed_job.4.pid
  start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user"
  stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!