summaryrefslogtreecommitdiffstats
path: root/charts.d
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2015-10-21 12:59:37 +0300
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2015-10-21 12:59:37 +0300
commitd27f5b4f627e587e45625a4cfebe0c7621923c69 (patch)
tree84d03489f8129cc5677a655ba189219840539587 /charts.d
parentfd733ea4cea2ff476ace40ca278edd61e55cb79b (diff)
fix to upper case variables in mysql
Diffstat (limited to 'charts.d')
-rwxr-xr-xcharts.d/mysql.chart.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/charts.d/mysql.chart.sh b/charts.d/mysql.chart.sh
index 75907b043f..72cbb41949 100755
--- a/charts.d/mysql.chart.sh
+++ b/charts.d/mysql.chart.sh
@@ -1,6 +1,11 @@
#!/bin/sh
# 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_cmd_opts=""
mysql_update_every=5
@@ -67,7 +72,6 @@ DIMENSION Sort_merge_passes merge_passes incremental 1 $((1 * mysql_update_every
DIMENSION Sort_range range incremental 1 $((1 * mysql_update_every))
DIMENSION Sort_scan scan incremental 1 $((1 * mysql_update_every))
EOF
-
return 0
}
@@ -92,7 +96,7 @@ mysql_update() {
# even if something goes wrong, no other code can be executed
eval "$(mysql_get_stats |\
- sed -e "s/[[:space:]]\+/ /g" -e "s/\./_/g" -e "s/^\([a-z0-9_]\+\)[[:space:]]\+\([0-9]\+\)$/local mysql_\1=\2/g" |\
+ sed -e "s/[[:space:]]\+/ /g" -e "s/\./_/g" -e "s/^\([a-zA-Z0-9_]\+\)[[:space:]]\+\([0-9]\+\)$/local mysql_\1=\2/g" |\
egrep "^local mysql_[a-zA-Z0-9_]+=[[:digit:]]+$")"
# write the result of the work.