Some useful monit commands and configs

Config for Sidekiq

# Monit configuration for Sidekiq : myAPP

check process sidekiq_thepact_qa0
 with pidfile "/home/deployer/www/qa/shared/tmp/pids/sidekiq.pid"
 start program = "/bin/su - deployer -c 'cd /home/deployer/www/qa/current && /usr/local/rvm/bin/rvm default do bundle exec sidekiq --config /home/deployer/www/qa/current/config/sidekiq.yml --index 0 -e qa -d'" with timeout 30 seconds
stop program = "/bin/su - deployer -c 'cd /home/deployer/www/qa/current && /usr/local/rvm/bin/rvm default do bundle exec sidekiqctl stop /home/deployer/www/qa/shared/tmp/pids/sidekiq.pid'" with timeout 110 seconds
 group myapp-sidekiq-qa

Commands

reload configuration

$ sudo monit reload

start monit

$ sudo service monit start