Advertisement
Guest User

Monit config

a guest
Jan 24th, 2013
435
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. alert email@example.com
  3. start program = "/bin/su - app_user -c '/home/app_user/app/shared/config/unicorn start'"
  4. stop program = "/bin/su - app_user -c '/home/app_user/app/shared/config/unicorn stop'"
  5. if mem is greater than 300.0 MB for 3 cycles then restart
  6. if cpu is greater than 50% for 6 cycles then alert
  7. if cpu is greater than 80% for 9 cycles then restart
  8. group my_cool_app_unicorn
  9.  
  10. check process my_cool_app_unicorn_worker_0 with pidfile /home/app_user/app/shared/tmp/pids/unicorn.0.pid
  11. start program = "/bin/true"
  12. 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`"
  13. if mem > 300.0 MB for 3 cycles then stop
  14. if cpu > 80% for 9 cycles then stop
  15. if 5 restarts within 15 cycles then timeout
  16. alert email@example.com only on { pid }
  17. if changed pid 2 times within 60 cycles then alert
  18. group my_cool_app_unicorn_workers
  19.  
  20.  
  21. check process my_cool_app_unicorn_worker_1 with pidfile /home/app_user/app/shared/tmp/pids/unicorn.1.pid
  22. start program = "/bin/true"
  23. 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`"
  24. if mem > 300.0 MB for 3 cycles then stop
  25. if cpu > 80% for 9 cycles then stop
  26. if 5 restarts within 15 cycles then timeout
  27. alert email@example.com only on { pid }
  28. if changed pid 2 times within 60 cycles then alert
  29. group my_cool_app_unicorn_workers
  30.  
  31.  
  32. check process resque_worker
  33. with pidfile /home/app_user/app/shared/tmp/pids/resque_worker.pid
  34. 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
  35. 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;'"
  36. if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory?
  37. group resque_workers
  38.  
  39. check process redis
  40. with pidfile /var/run/redis.pid
  41. start program = "/usr/local/bin/redis-server /usr/local/etc/redis.conf"
  42. stop program = "/usr/local/bin/redis-cli -p 6379 shutdown"
  43.  
  44. check process nginx with pidfile /var/run/nginx.pid
  45. alert email@example.com
  46. start program = "/usr/local/etc/rc.d/nginx start"
  47. stop program = "/usr/local/etc/rc.d/nginx stop"
  48. if children > 250 then restart
  49. if 5 restarts within 5 cycles then timeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement