Skip to content

Instantly share code, notes, and snippets.

@eksiscloud
Created April 22, 2020 17:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save eksiscloud/f936349926c048d3d5e42a8ee39124fa to your computer and use it in GitHub Desktop.
Save eksiscloud/f936349926c048d3d5e42a8ee39124fa to your computer and use it in GitHub Desktop.
Monit: MariaDB and MySQL
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
group database
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment