diff options
author | paulfantom <paulfantom@gmail.com> | 2016-06-15 23:24:49 +0200 |
---|---|---|
committer | paulfantom <paulfantom@gmail.com> | 2016-06-15 23:28:02 +0200 |
commit | 7ee587c5d77f3b7cb7f63e12ca1fc9435471d95c (patch) | |
tree | 030d6939bf28bd52b419c0e8f0086ef645a1478d /charts.d/mysql.chart.sh | |
parent | 1695134ed021019b7db9bf23fe80047f58a4c6ac (diff) |
fix issue when dealing with MySQL
Diffstat (limited to 'charts.d/mysql.chart.sh')
-rwxr-xr-x | charts.d/mysql.chart.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/charts.d/mysql.chart.sh b/charts.d/mysql.chart.sh index fe07658eaa..30ad74ea31 100755 --- a/charts.d/mysql.chart.sh +++ b/charts.d/mysql.chart.sh @@ -17,7 +17,8 @@ mysql_get() { local oIFS="${IFS}" mysql_data=() IFS=$'\t'$'\n' - 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=($("${@}" -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]" )) IFS="${oIFS}" [ "${#arr[@]}" -lt 3 ] && return 1 |