]> arthur.barton.de Git - netdata.git/blob - conf.d/health.d/mysql.conf
78773e5b5b0b141489d334cbdbaf0b5bbe535b11
[netdata.git] / conf.d / health.d / mysql.conf
1
2 # make sure mysql is running
3
4 template: mysql_last_collected_secs
5       on: mysql.queries
6     calc: $now - $last_collected_t
7    units: seconds ago
8    every: 10s
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
13       to: dba
14
15
16 # -----------------------------------------------------------------------------
17 # slow queries
18
19 template: mysql_10s_slow_queries
20       on: mysql.queries
21   lookup: sum -10s of slow_queries
22    units: slow queries
23    every: 10s
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
28       to: dba
29
30
31 # -----------------------------------------------------------------------------
32 # lock waits
33
34 template: mysql_10s_table_locks_immediate
35       on: mysql.table_locks
36   lookup: sum -10s absolute of immediate
37    units: immediate locks
38    every: 10s
39     info: number of table immediate locks over the last 10 seconds
40       to: dba
41
42 template: mysql_10s_table_locks_waited
43       on: mysql.table_locks
44   lookup: sum -10s absolute of waited
45    units: waited locks
46    every: 10s
47     info: number of table waited locks over the last 10 seconds
48       to: dba
49
50 template: mysql_10s_waited_locks_ratio
51       on: mysql.table_locks
52     calc: ($mysql_10s_table_locks_waited * 100) / ($mysql_10s_table_locks_waited + $mysql_10s_table_locks_immediate)
53    units: %
54    every: 10s
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
59       to: dba
60
61
62 # -----------------------------------------------------------------------------
63 # replication
64
65 template: mysql_replication
66       on: mysql.slave_status
67     calc: ($sql_running == -1 OR $io_running == -1)?0:1
68    units: status
69    every: 10s
70     crit: $this == 0
71    delay: down 5m multiplier 1.5 max 1h
72     info: checks if mysql replication has stopped
73       to: dba
74
75 template: mysql_replication_lag
76       on: mysql.slave_behind
77     calc: $seconds
78    units: seconds
79    every: 10s
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
84       to: dba
85