]> arthur.barton.de Git - netdata.git/blob - conf.d/health.d/mysql.conf
added mysql slow_queries and waited locks alarms; #1454
[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 # slow queries
17
18 template: mysql_10s_slow_queries
19       on: mysql.queries
20   lookup: sum -10s of slow_queries
21    units: slow queries
22    every: 10s
23     warn: $this > (($status >= $WARNING)  ? (5)  : (10))
24     crit: $this > (($status == $CRITICAL) ? (10) : (20))
25    delay: down 5m multiplier 1.5 max 1h
26     info: number of mysql slow queries over the last 10 seconds
27       to: dba
28
29
30 # -----------------------------------------------------------------------------
31 # lock waits
32
33 template: mysql_10s_table_locks_immediate
34       on: mysql.table_locks
35   lookup: sum -10s absolute of immediate
36    units: immediate locks
37    every: 10s
38     info: number of table immediate locks over the last 10 seconds
39       to: dba
40
41 template: mysql_10s_table_locks_waited
42       on: mysql.table_locks
43   lookup: sum -10s absolute of waited
44    units: waited locks
45    every: 10s
46     info: number of table waited locks over the last 10 seconds
47       to: dba
48
49 template: mysql_10s_waited_locks_ratio
50       on: mysql.table_locks
51     calc: $mysql_10s_table_locks_waited * 100 / ( $mysql_10s_table_locks_waited + $mysql_10s_table_locks_immediate)
52    units: %
53    every: 10s
54     warn: $this > (($status >= $WARNING)  ? (10) : (20))
55     crit: $this > (($status == $CRITICAL) ? (20) : (50))
56    delay: down 5m multiplier 1.5 max 1h
57     info: the ratio of mysql waited table locks, for the last 10 seconds
58       to: dba
59