]> arthur.barton.de Git - netdata.git/blobdiff - charts.d/mysql.chart.sh
fixed fom mysql not reading Handler_X values in older systems
[netdata.git] / charts.d / mysql.chart.sh
index 29d8b61bce6a73bfffdfeaa506b50d8635edf1a4..e2392c23dcdc1dff4615a0d4a54328b7e718e9a0 100755 (executable)
@@ -17,7 +17,9 @@ mysql_get() {
        local oIFS="${IFS}"
        mysql_data=()
        IFS=$'\t'$'\n'
-       arr=($("${@}" -e "SHOW GLOBAL STATUS WHERE value REGEXP '^[0-9]';" | egrep "^(Bytes|Slow_|Queri|Handl|Table|Selec|Sort_|Creat|Conne|Abort|Binlo|Threa|Innod|Qcach|Key_|Open)" ))
+       #arr=($("${@}" -e "SHOW GLOBAL STATUS WHERE value REGEXP '^[0-9]';" | egrep "^(Bytes|Slow_|Que|Handl|Table|Selec|Sort_|Creat|Conne|Abort|Binlo|Threa|Innod|Qcach|Key_|Open)" ))
+       #arr=($("${@}" -N -e "SHOW GLOBAL STATUS;" | egrep "^(Bytes|Slow_|Que|Handl|Table|Selec|Sort_|Creat|Conne|Abort|Binlo|Threa|Innod|Qcach|Key_|Open)[^ ]+\s[0-9]" ))
+       arr=($("${@}" -N -e "SHOW GLOBAL STATUS;" | egrep "^(Bytes|Slow_|Que|Handl|Table|Selec|Sort_|Creat|Conne|Abort|Binlo|Threa|Innod|Qcach|Key_|Open)[^[:space:]]+[[:space:]]+[0-9]+" ))
        IFS="${oIFS}"
 
        [ "${#arr[@]}" -lt 3 ] && return 1
@@ -449,7 +451,7 @@ END
 BEGIN mysql_$x.qcache_ops $1
 SET Qcache_hits hits = ${mysql_data[Qcache_hits]}
 SET Qcache_lowmem_prunes = ${mysql_data[Qcache_lowmem_prunes]}
-SET Qcache_inserts_inserts = ${mysql_data[Qcache_inserts_inserts]}
+SET Qcache_inserts = ${mysql_data[Qcache_inserts]}
 SET Qcache_not_cached = ${mysql_data[Qcache_not_cached]}
 END
 BEGIN mysql_$x.qcache $1