How to monitor delayed_job with monit

后端 未结 13 828
醉酒成梦
醉酒成梦 2020-12-02 04:11

Are there any examples on the web of how to monitor delayed_job with Monit?

Everything I can find uses God, but I refuse to use God since long running processes in

13条回答
  •  暖寄归人
    2020-12-02 04:22

    to see what is going on, run monit in foreground verbose mode: sudo monit -Iv

    using rvm installed under user "www1" and group "www1".

    in file /etc/monit/monitrc:

    #delayed_job
    check process delayed_job with pidfile /home/www1/your_app/current/tmp/pids/delayed_job.pid
        start program "/bin/bash -c 'PATH=$PATH:/home/www1/.rvm/bin;source /home/www1/.rvm/scripts/rvm;cd /home/www1/your_app/current;RAILS_ENV=production bundle exec script/delayed_job start'" as uid www1 and gid www1
        stop program "/bin/bash -c 'PATH=$PATH:/home/www1/.rvm/bin;source /home/www1/.rvm/scripts/rvm;cd /home/www1/your_app/current;RAILS_ENV=production bundle exec script/delayed_job stop'" as uid www1 and gid www1
        if totalmem is greater than 200 MB for 2 cycles then alert
    

提交回复
热议问题