2 # make sure mysql is running
4 template: mysql_last_collected_secs
6 calc: $now - $last_collected_t
9 warn: $this > (($status >= $WARNING) ? ($update_every) : ( 5 * $update_every))
10 crit: $this > (($status == $CRITICAL) ? ($update_every) : (60 * $update_every))
11 delay: down 5m multiplier 1.5 max 1h
12 info: number of seconds since the last successful data collection
16 # -----------------------------------------------------------------------------
19 template: mysql_10s_slow_queries
21 lookup: sum -10s of slow_queries
24 warn: $this > (($status >= $WARNING) ? (5) : (10))
25 crit: $this > (($status == $CRITICAL) ? (10) : (20))
26 delay: down 5m multiplier 1.5 max 1h
27 info: number of mysql slow queries over the last 10 seconds
31 # -----------------------------------------------------------------------------
34 template: mysql_10s_table_locks_immediate
36 lookup: sum -10s absolute of immediate
37 units: immediate locks
39 info: number of table immediate locks over the last 10 seconds
42 template: mysql_10s_table_locks_waited
44 lookup: sum -10s absolute of waited
47 info: number of table waited locks over the last 10 seconds
50 template: mysql_10s_waited_locks_ratio
52 calc: ( ($mysql_10s_table_locks_waited + $mysql_10s_table_locks_immediate) > 0 ) ? (($mysql_10s_table_locks_waited * 100) / ($mysql_10s_table_locks_waited + $mysql_10s_table_locks_immediate)) : 0
55 warn: $this > (($status >= $WARNING) ? (10) : (25))
56 crit: $this > (($status == $CRITICAL) ? (25) : (50))
57 delay: down 30m multiplier 1.5 max 1h
58 info: the ratio of mysql waited table locks, for the last 10 seconds
62 # -----------------------------------------------------------------------------
65 template: mysql_replication
66 on: mysql.slave_status
67 calc: ($sql_running == -1 OR $io_running == -1)?0:1
71 delay: down 5m multiplier 1.5 max 1h
72 info: checks if mysql replication has stopped
75 template: mysql_replication_lag
76 on: mysql.slave_behind
80 warn: $this > (($status >= $WARNING) ? (5) : (10))
81 crit: $this > (($status == $CRITICAL) ? (10) : (30))
82 delay: down 15m multiplier 1.5 max 1h
83 info: the number of seconds mysql replication is behind this master