]> arthur.barton.de Git - netdata.git/blob - conf.d/health.d/mysql.conf
e6f309fe8702e7a101f28044462289b06215ca3d
[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) : (20))
56     crit: $this > (($status == $CRITICAL) ? (20) : (50))
57    delay: down 5m 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 # replication
63
64 template: mysql_replication
65       on: mysql.slave_status
66     calc: ($sql_running == -1 OR $io_running == -1)?0:1
67    units: status
68    every: 10s
69     crit: $this == 0
70    delay: down 5m multiplier 1.5 max 1h
71     info: checks if mysql replication has stopped
72       to: dba
73
74 template: mysql_replication_lag
75       on: mysql.slave_behind
76     calc: $seconds
77    units: seconds
78    every: 10s
79     warn: $this > (($status >= $WARNING)  ? (5)  : (10))
80     crit: $this > (($status == $CRITICAL) ? (10) : (30))
81    delay: down 5m multiplier 1.5 max 1h
82     info: the number of seconds mysql replication is behind this master
83       to: dba
84