Skip to content

Instantly share code, notes, and snippets.

@tomazzaman
Last active May 13, 2021 19:44
Show Gist options
  • Save tomazzaman/ae63a63b96278bc0a4a1 to your computer and use it in GitHub Desktop.
Save tomazzaman/ae63a63b96278bc0a4a1 to your computer and use it in GitHub Desktop.

Revisions

  1. tomazzaman revised this gist Feb 4, 2015. 5 changed files with 14 additions and 13 deletions.
    4 changes: 2 additions & 2 deletions hhvm.conf
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    check process hhvm with pidfile /var/run/hhvm/pid
    group hhvm
    start program = "/etc/init.d/hhvm start" with timeout 60 seconds
    stop program = "/etc/init.d/hhvm stop"
    start program = "/usr/sbin/service hhvm start" with timeout 60 seconds
    stop program = "/usr/sbin/service hhvm stop"
    if failed unixsocket /var/run/hhvm/hhvm.sock then restart
    if mem > 400.0 MB for 1 cycles then restart
    if 5 restarts with 5 cycles then timeout
    6 changes: 3 additions & 3 deletions mysql.conf
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    check process mysqld with pidfile /var/run/mysqld/mysqld.pid
    group mysql
    start program = "/etc/init.d/mysql start"
    stop program = "/etc/init.d/mysql stop"
    start program = "/usr/sbin/service mysql start"
    stop program = "/usr/sbin/service mysql stop"
    if failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles then restart
    if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restart
    if 5 restarts with 5 cycles then timeout
    if 5 restarts with 5 cycles then timeout
    6 changes: 3 additions & 3 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    check process nginx with pidfile /var/run/nginx.pid
    group nginx
    start program = "/etc/init.d/nginx start"
    stop program = "/etc/init.d/nginx stop"
    start program = "/usr/sbin/service nginx start"
    stop program = "/usr/sbin/service nginx stop"
    if failed host 127.0.0.1 port 80 then restart
    if cpu is greater than 40% for 2 cycles then alert
    if cpu > 60% for 5 cycles then restart
    if 10 restarts within 10 cycles then timeout
    if 10 restarts within 10 cycles then timeout
    4 changes: 2 additions & 2 deletions php-fpm.conf → php5-fpm.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    check process php5-fpm with pidfile /var/run/php5-fpm.pid
    group phpcgi
    start program = "/etc/init.d/php5-fpm start"
    stop program = "/etc/init.d/php5-fpm stop"
    start program = "/usr/sbin/service php5-fpm start"
    stop program = "/usr/sbin/service php5-fpm stop"
    if failed unixsocket /var/run/php5-fpm.sock then restart
    if 3 restarts within 5 cycles then timeout
    7 changes: 4 additions & 3 deletions redis.conf
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,10 @@
    check process redis-server with pidfile /var/run/redis/redis-server.pid
    group redis
    start program = "/etc/init.d/redis-server start"
    stop program = "/etc/init.d/redis-server stop"
    start program = "/usr/sbin/service redis-server start"
    stop program = "/usr/sbin/service redis-server stop"
    if 2 restarts within 3 cycles then timeout
    if totalmem > 100 Mb then alert
    if children > 255 for 5 cycles then stop
    if cpu usage > 95% for 3 cycles then restart
    if failed host 127.0.0.1 port 6379 then restart
    if 5 restarts within 5 cycles then timeout
    if 5 restarts within 5 cycles then timeout
  2. tomazzaman revised this gist Feb 4, 2015. 2 changed files with 2 additions and 3 deletions.
    4 changes: 2 additions & 2 deletions php-fpm.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    check process php5-fpm with pidfile /var/run/php5-fpm.pid
    group php5-fpm
    group phpcgi
    start program = "/etc/init.d/php5-fpm start"
    stop program = "/etc/init.d/php5-fpm stop"
    if failed unixsocket /var/run/php5-fpm.sock then restart
    if 3 restarts within 5 cycles then timeout
    if 3 restarts within 5 cycles then timeout
    1 change: 0 additions & 1 deletion redis.conf
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,6 @@ check process redis-server with pidfile /var/run/redis/redis-server.pid
    stop program = "/etc/init.d/redis-server stop"
    if 2 restarts within 3 cycles then timeout
    if totalmem > 100 Mb then alert
    if children > 255 for 5 cycles then stop
    if cpu usage > 95% for 3 cycles then restart
    if failed host 127.0.0.1 port 6379 then restart
    if 5 restarts within 5 cycles then timeout
  3. tomazzaman revised this gist Feb 4, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions php-fpm.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    check process php5-fpm with pidfile /var/run/php5-fpm.pid
    group phpcgi
    group php5-fpm
    start program = "/etc/init.d/php5-fpm start"
    stop program = "/etc/init.d/php5-fpm stop"
    if failed unixsocket /var/run/php5-fpm.sock then restart
    if 3 restarts within 5 cycles then timeout
    if 3 restarts within 5 cycles then timeout
  4. tomazzaman revised this gist Feb 4, 2015. 5 changed files with 3 additions and 53 deletions.
    12 changes: 1 addition & 11 deletions hhvm.conf
    Original file line number Diff line number Diff line change
    @@ -4,14 +4,4 @@ check process hhvm with pidfile /var/run/hhvm/pid
    stop program = "/etc/init.d/hhvm stop"
    if failed unixsocket /var/run/hhvm/hhvm.sock then restart
    if mem > 400.0 MB for 1 cycles then restart
    if 5 restarts with 5 cycles then timeout
    depend hhvm_bin
    depend hhvm_rc

    check file hhvm_bin with path /usr/bin/hhvm
    group hhvm
    include /etc/monit/templates/rootbin

    check file hhvm_rc with path /etc/init.d/hhvm
    group hhvm
    include /etc/monit/templates/rootbin
    if 5 restarts with 5 cycles then timeout
    10 changes: 0 additions & 10 deletions mysql.conf
    Original file line number Diff line number Diff line change
    @@ -5,13 +5,3 @@ check process mysqld with pidfile /var/run/mysqld/mysqld.pid
    if failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles then restart
    if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restart
    if 5 restarts with 5 cycles then timeout
    depend mysql_bin
    depend mysql_rc

    check file mysql_bin with path /usr/sbin/mysqld
    group mysql
    include /etc/monit/templates/rootbin

    check file mysql_rc with path /etc/init.d/mysql
    group mysql
    include /etc/monit/templates/rootbin
    10 changes: 0 additions & 10 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -6,13 +6,3 @@ check process nginx with pidfile /var/run/nginx.pid
    if cpu is greater than 40% for 2 cycles then alert
    if cpu > 60% for 5 cycles then restart
    if 10 restarts within 10 cycles then timeout
    depend nginx_bin
    depend nginx_rc

    check file nginx_bin with path /usr/sbin/nginx
    group nginx
    include /etc/monit/templates/rootbin

    check file nginx_rc with path /etc/init.d/nginx
    group nginx
    include /etc/monit/templates/rootbin
    14 changes: 2 additions & 12 deletions php-fpm.conf
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,6 @@
    check process php5-fpm-unix with pidfile /var/run/php5-fpm.pid
    check process php5-fpm with pidfile /var/run/php5-fpm.pid
    group phpcgi
    start program = "/etc/init.d/php5-fpm start"
    stop program = "/etc/init.d/php5-fpm stop"
    if failed unixsocket /var/run/php-fpm.sock then restart
    if failed unixsocket /var/run/php5-fpm.sock then restart
    if 3 restarts within 5 cycles then timeout
    depend php5-fpm_bin
    depend php5-fpm_rc

    check file php5-fpm_bin with path /usr/sbin/php5-fpm
    group phpcgi
    include /etc/monit/templates/rootbin

    check file php5-fpm_rc with path /etc/init.d/php5-fpm
    group phpcgi
    include /etc/monit/templates/rootbin
    10 changes: 0 additions & 10 deletions redis.conf
    Original file line number Diff line number Diff line change
    @@ -8,13 +8,3 @@ check process redis-server with pidfile /var/run/redis/redis-server.pid
    if cpu usage > 95% for 3 cycles then restart
    if failed host 127.0.0.1 port 6379 then restart
    if 5 restarts within 5 cycles then timeout
    depend redis_bin
    depend redis_rc

    check file redis_bin with path /usr/bin/redis-server
    group redis
    include /etc/monit/templates/rootbin

    check file redis_rc with path /etc/init.d/redis-server
    group redis
    include /etc/monit/templates/rootbin
  5. tomazzaman created this gist Feb 3, 2015.
    17 changes: 17 additions & 0 deletions hhvm.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    check process hhvm with pidfile /var/run/hhvm/pid
    group hhvm
    start program = "/etc/init.d/hhvm start" with timeout 60 seconds
    stop program = "/etc/init.d/hhvm stop"
    if failed unixsocket /var/run/hhvm/hhvm.sock then restart
    if mem > 400.0 MB for 1 cycles then restart
    if 5 restarts with 5 cycles then timeout
    depend hhvm_bin
    depend hhvm_rc

    check file hhvm_bin with path /usr/bin/hhvm
    group hhvm
    include /etc/monit/templates/rootbin

    check file hhvm_rc with path /etc/init.d/hhvm
    group hhvm
    include /etc/monit/templates/rootbin
    17 changes: 17 additions & 0 deletions mysql.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    check process mysqld with pidfile /var/run/mysqld/mysqld.pid
    group mysql
    start program = "/etc/init.d/mysql start"
    stop program = "/etc/init.d/mysql stop"
    if failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles then restart
    if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restart
    if 5 restarts with 5 cycles then timeout
    depend mysql_bin
    depend mysql_rc

    check file mysql_bin with path /usr/sbin/mysqld
    group mysql
    include /etc/monit/templates/rootbin

    check file mysql_rc with path /etc/init.d/mysql
    group mysql
    include /etc/monit/templates/rootbin
    18 changes: 18 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    check process nginx with pidfile /var/run/nginx.pid
    group nginx
    start program = "/etc/init.d/nginx start"
    stop program = "/etc/init.d/nginx stop"
    if failed host 127.0.0.1 port 80 then restart
    if cpu is greater than 40% for 2 cycles then alert
    if cpu > 60% for 5 cycles then restart
    if 10 restarts within 10 cycles then timeout
    depend nginx_bin
    depend nginx_rc

    check file nginx_bin with path /usr/sbin/nginx
    group nginx
    include /etc/monit/templates/rootbin

    check file nginx_rc with path /etc/init.d/nginx
    group nginx
    include /etc/monit/templates/rootbin
    16 changes: 16 additions & 0 deletions php-fpm.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    check process php5-fpm-unix with pidfile /var/run/php5-fpm.pid
    group phpcgi
    start program = "/etc/init.d/php5-fpm start"
    stop program = "/etc/init.d/php5-fpm stop"
    if failed unixsocket /var/run/php-fpm.sock then restart
    if 3 restarts within 5 cycles then timeout
    depend php5-fpm_bin
    depend php5-fpm_rc

    check file php5-fpm_bin with path /usr/sbin/php5-fpm
    group phpcgi
    include /etc/monit/templates/rootbin

    check file php5-fpm_rc with path /etc/init.d/php5-fpm
    group phpcgi
    include /etc/monit/templates/rootbin
    20 changes: 20 additions & 0 deletions redis.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    check process redis-server with pidfile /var/run/redis/redis-server.pid
    group redis
    start program = "/etc/init.d/redis-server start"
    stop program = "/etc/init.d/redis-server stop"
    if 2 restarts within 3 cycles then timeout
    if totalmem > 100 Mb then alert
    if children > 255 for 5 cycles then stop
    if cpu usage > 95% for 3 cycles then restart
    if failed host 127.0.0.1 port 6379 then restart
    if 5 restarts within 5 cycles then timeout
    depend redis_bin
    depend redis_rc

    check file redis_bin with path /usr/bin/redis-server
    group redis
    include /etc/monit/templates/rootbin

    check file redis_rc with path /etc/init.d/redis-server
    group redis
    include /etc/monit/templates/rootbin
    4 changes: 4 additions & 0 deletions system.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    check system server
    if memory > 85% 2 times within 3 cycles then alert
    if cpu(user) > 75% for 2 cycles then alert
    if cpu(system) > 65% for 2 cycles then alert