Skip to content

Instantly share code, notes, and snippets.

View desyncr's full-sized avatar

DC* desyncr

View GitHub Profile
@desyncr
desyncr / gist:8458120
Last active January 3, 2016 11:48
Monit Gearman configuration
check process gearman_daemon_worker_user_share
matching "user.documentshare"
start program = "/usr/bin/php /var/www/sm/public/index.php gearman worker execute user.documentshare"
stop program = "/usr/bin/pkill --full user.documentshare"
check process gearman_daemon_worker_user_registration
matching "user.registration"
start program = "/usr/bin/php /var/www/sm/public/index.php gearman worker execute user.registration"
stop program = "/usr/bin/pkill --full user.registration"
@desyncr
desyncr / gist:8458131
Created January 16, 2014 16:34
Monit ZMQ configuration
check process zmq_daemon
matching "zmq daemon execute"
start program = "/usr/bin/php /var/www/sm/public/index.php zmq daemon execute"
stop program = "/usr/bin/pkill --full zmq daemon execute"
@desyncr
desyncr / zmq
Last active April 12, 2018 15:57
Monit check pid-less process (without script)
check process zmq with pidfile '/tmp/zmq.pid'
start program '/bin/bash -c "/usr/bin/php /var/www/sm/public/index.php zmq daemon execute & echo $! > /tmp/zmq.pid"'
stop program '/usr/bin/killall --full "zmq daemon execute"'
@desyncr
desyncr / gist:8474439
Created January 17, 2014 14:39
Gearman workers
check process gearman_daemon_worker_user_share
with pidfile "/var/run/gearman_worker_user_share.pid"
start program "/bin/bash -c '/usr/bin/php /var/www/sm/public/index.php gearman worker execute user.documentshare & echo $! > /var/run/gearman_worker_user_share.pid'"
stop program "/usr/bin/pkill --full user.documentshare"
check process gearman_daemon_worker_user_registration
with pidfile "/var/run/gearman_worker_user_registration.pid"
start program "/bin/bash -c '/usr/bin/php /var/www/sm/public/index.php gearman worker execute user.registration & echo $! > /var/run/gearman_worker_user_registration.pid'"
stop program "/usr/bin/pkill --full user.registration"
@desyncr
desyncr / gist:8474448
Created January 17, 2014 14:40
Monit gearmand
check process gearman_daemon with pidfile '/var/run/gearman/gearmand.pid'
start program "/usr/sbin/gearmand --pid-file=/var/run/gearman/gearmand.pid --user=gearman --daemon --log-file=/var/log/gearman-job-server/gearman.log --listen=127.0.0.1"
stop program "/usr/bin/killall --full gearmand"
@desyncr
desyncr / gen_monit_configuration
Last active January 4, 2016 05:59
Bash script to generate monit configuration for Gearman workers
#!/bin/bash
# This script creates a monit-compatible configuration file to start and monitor Gearman workers.
#
# options are:
# [W]orkers -- List of workers IDs
# [p]hp -- Full path to the PHP binary
# [l]aunch -- Command to start the workers
# [w]ebroot -- Full path where the web application resides
# [k]ill -- Kill command to stop the workers
# [L]og -- Log path for workers to output debug information
@desyncr
desyncr / gearman_workers
Last active December 28, 2016 03:41
Monit configuration for monitoring Gearman workers
# Script generated Fri Jan 24 17:06:34 ART 2014 by root(0)
check process gearman.worker.user.user_registration with pidfile "/var/run/gearman.worker.user.user_registration.pid"
start program "/bin/bash -c '/home/dario/.phpbrew/php/php-5.4.23/bin/php /home/dario/Playground/sm/public/index.php gearman worker execute user.user_registration >> /tmp/gearman.worker.user.user_registration.log & echo $! > /var/run/gearman.worker.user.user_registration.pid'"
stop program "/usr/bin/pkill --full user.user_registration"
check process gearman.worker.user.user_invitation with pidfile "/var/run/gearman.worker.user.user_invitation.pid"
start program "/bin/bash -c '/home/dario/.phpbrew/php/php-5.4.23/bin/php /home/dario/Playground/sm/public/index.php gearman worker execute user.user_invitation >> /tmp/gearman.worker.user.user_invitation.log & echo $! > /var/run/gearman.worker.user.user_invitation.pid'"
stop program "/usr/bin/pkill --full user.user_invitation"
@desyncr
desyncr / zmq_daemon
Last active January 4, 2016 09:19
Monit configuration for ZMQ daemon
check process zmq.daemon with pidfile '/var/run/zmq.daemon.pid'
start program "/bin/bash -c '/usr/bin/php /var/www/sm/public/index.php zmq daemon execute & echo $! > /var/run/zmq.daemon.pid'"
stop program "/usr/bin/pkill --full zmq daemon execute"
@desyncr
desyncr / gearmand
Last active August 29, 2015 13:56
Gearmand monit configuration
check process gearman_daemon with pidfile '/usr/local/var/gearmand.pid'
start program "/usr/local/sbin/gearmand --pid-file /usr/local/var/gearmand.pid --queue-type postgres --libpq-conninfo 'host=127.0.0.1 dbname=DBNAME user=USER password=PASSWORD' --libpq-table queue --verbose DEBUG"
stop program "/usr/bin/killall --full gearmand"
check process gearman.worker.user.user_appointment_request with pidfile "/var/run/gearman.worker.user.user_appointment_request.pid"
start program "/bin/bash -c '/usr/bin/php /srv/www/htdocs/sm/truck/SaludMovil/public/index.php gearman worker execute user.user_appointment_request >> /tmp/gearman.worker.user.user_appointment_request.log & echo $! > /var/run/gearman.worker.user.user_appointment_request.pid'"
stop program "/usr/bin/pkill --full user.user_appointment_request"