# no need for shebang - this file is loaded from charts.d.plugin # netdata # real-time performance and health monitoring, done right! # (C) 2016 Costa Tsaousis # GPL v3+ # # http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html # # https://dev.mysql.com/doc/refman/5.1/en/show-status.html # SHOW STATUS provides server status information (see Section 5.1.6, “Server Status Variables”). # This statement does not require any privilege. # It requires only the ability to connect to the server. mysql_update_every=2 mysql_priority=60000 declare -A mysql_cmds=() mysql_opts=() mysql_ids=() mysql_data=() mysql_get() { local arr local oIFS="${IFS}" mysql_data=() IFS=$'\t'$'\n' #arr=($(run "${@}" -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=($(run "${@}" -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=($(run "${@}" -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 local end=${#arr[@]} for ((i=2;i