-
Notifications
You must be signed in to change notification settings - Fork 19
/
mysql
39 lines (34 loc) · 1.36 KB
/
mysql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- mode: conf; mode: flyspell-prog; mode: autopair; ispell-current-dictionary: american -*-
### Monit configuration for MySQL. Adapted from the Monit Wiki:
### http://mmonit.com/wiki/Monit/ConfigurationExamples#mysqld
## Test the mysql service.
check process mysql with pidfile /var/run/mysqld/mysqld.pid
group mysql
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
# *** Enable the line below for TCP socket support. ***
# if failed port 3306 protocol mysql then restart
# This uses UNIX sockets.
if failed unixsocket /var/run/mysqld/mysqld.sock then restart
if 3 restarts within 5 cycles then timeout
# This process check depends on checking the binary if the MySQL
# daemon and the init script.
depends on mysqld
depends on mysql_init
alert root@localhost only on {timeout}
## Test the mysqld binary.
check file mysqld with path /usr/sbin/mysqld
group mysql
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed uid root then unmonitor
if failed gid root then unmonitor
alert root@localhost
## Test the init scripts.
check file mysql_init with path /etc/init.d/mysql
group mysql
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed uid root then unmonitor
if failed gid root then unmonitor
alert root@localhost