Guest User

Monit config

a guest
Jan 24th, 2013
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. check process my_cool_app_unicorn with pidfile /home/app_user/app/shared/tmp/pids/unicorn.pid
  2. start program = "/bin/su - app_user -c '/home/app_user/app/shared/config/unicorn start'"
  3. stop program = "/bin/su - app_user -c '/home/app_user/app/shared/config/unicorn stop'"
  4. if mem is greater than 300.0 MB for 3 cycles then restart
  5. if cpu is greater than 50% for 6 cycles then alert
  6. if cpu is greater than 80% for 9 cycles then restart
  7. group my_cool_app_unicorn
  8.  
  9. check process my_cool_app_unicorn_worker_0 with pidfile /home/app_user/app/shared/tmp/pids/unicorn.0.pid
  10. start program = "/bin/true"
  11. stop program = "/usr/bin/test -s /home/app_user/app/shared/tmp/pids/unicorn.0.pid && /bin/kill -QUIT `cat /home/app_user/app/shared/tmp/pids/unicorn.0.pid`"
  12. if mem > 300.0 MB for 3 cycles then stop
  13. if cpu > 80% for 9 cycles then stop
  14. if 5 restarts within 15 cycles then timeout
  15. alert [email protected] only on { pid }
  16. if changed pid 2 times within 60 cycles then alert
  17. group my_cool_app_unicorn_workers
  18.  
  19.  
  20. check process my_cool_app_unicorn_worker_1 with pidfile /home/app_user/app/shared/tmp/pids/unicorn.1.pid
  21. start program = "/bin/true"
  22. stop program = "/usr/bin/test -s /home/app_user/app/shared/tmp/pids/unicorn.1.pid && /bin/kill -QUIT `cat /home/app_user/app/shared/tmp/pids/unicorn.1.pid`"
  23. if mem > 300.0 MB for 3 cycles then stop
  24. if cpu > 80% for 9 cycles then stop
  25. if 5 restarts within 15 cycles then timeout
  26. alert [email protected] only on { pid }
  27. if changed pid 2 times within 60 cycles then alert
  28. group my_cool_app_unicorn_workers
  29.  
  30.  
  31. check process resque_worker
  32. with pidfile /home/app_user/app/shared/tmp/pids/resque_worker.pid
  33. start program = "/bin/su - app_user -c 'export RUBYOPT=-Ku;cd /home/app_user/app/current;bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production VERBOSE=1 PIDFILE=/home/app_user/app/shared/tmp/pids/resque_worker.pid & >> /home/app_user/app/shared/log/resque_worker.log 2>&1'" as uid app_user and gid app_user
  34. stop program = "/bin/sh -c 'kill -9 $(cat /home/app_user/app/shared/tmp/pids/resque_worker.pid) && rm -f /home/app_user/app/shared/tmp/pids/resque_worker.pid; exit 0;'"
  35. if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory?
  36. group resque_workers
  37.  
  38. check process redis
  39. with pidfile /var/run/redis.pid
  40. start program = "/usr/local/bin/redis-server /usr/local/etc/redis.conf"
  41. stop program = "/usr/local/bin/redis-cli -p 6379 shutdown"
  42.  
  43. check process nginx with pidfile /var/run/nginx.pid
  44. start program = "/usr/local/etc/rc.d/nginx start"
  45. stop program = "/usr/local/etc/rc.d/nginx stop"
  46. if children > 250 then restart
  47. if 5 restarts within 5 cycles then timeout
Advertisement
Add Comment
Please, Sign In to add comment