]> arthur.barton.de Git - netdata.git/commitdiff
added mysql slow_queries and waited locks alarms; #1454
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 29 Dec 2016 16:10:21 +0000 (18:10 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 29 Dec 2016 16:10:21 +0000 (18:10 +0200)
conf.d/health.d/mysql.conf

index f95d7c598c961d721a74660ae38374c56ffc5665..6e32f9d3151fc446c3cac4c3d203dc80e8e7288b 100644 (file)
@@ -11,3 +11,49 @@ template: mysql_last_collected_secs
    delay: down 5m multiplier 1.5 max 1h
     info: number of seconds since the last successful data collection
       to: dba
+
+# -----------------------------------------------------------------------------
+# slow queries
+
+template: mysql_10s_slow_queries
+      on: mysql.queries
+  lookup: sum -10s of slow_queries
+   units: slow queries
+   every: 10s
+    warn: $this > (($status >= $WARNING)  ? (5)  : (10))
+    crit: $this > (($status == $CRITICAL) ? (10) : (20))
+   delay: down 5m multiplier 1.5 max 1h
+    info: number of mysql slow queries over the last 10 seconds
+      to: dba
+
+
+# -----------------------------------------------------------------------------
+# lock waits
+
+template: mysql_10s_table_locks_immediate
+      on: mysql.table_locks
+  lookup: sum -10s absolute of immediate
+   units: immediate locks
+   every: 10s
+    info: number of table immediate locks over the last 10 seconds
+      to: dba
+
+template: mysql_10s_table_locks_waited
+      on: mysql.table_locks
+  lookup: sum -10s absolute of waited
+   units: waited locks
+   every: 10s
+    info: number of table waited locks over the last 10 seconds
+      to: dba
+
+template: mysql_10s_waited_locks_ratio
+      on: mysql.table_locks
+    calc: $mysql_10s_table_locks_waited * 100 / ( $mysql_10s_table_locks_waited + $mysql_10s_table_locks_immediate)
+   units: %
+   every: 10s
+    warn: $this > (($status >= $WARNING)  ? (10) : (20))
+    crit: $this > (($status == $CRITICAL) ? (20) : (50))
+   delay: down 5m multiplier 1.5 max 1h
+    info: the ratio of mysql waited table locks, for the last 10 seconds
+      to: dba
+