Merge branch 'collect_ndb_status' of https://github.com/fipar/percona-toolkit into fipar-collect_ndb_status

This commit is contained in:
Carlos Salguero
2018-03-19 15:38:17 -03:00
2 changed files with 21 additions and 0 deletions

View File

@@ -108,6 +108,10 @@ collect_mysql_innodb_status () {
$CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW /*!50000 ENGINE*/ INNODB STATUS' 2>/dev/null
}
collect_mysql_ndb_status () {
$CMD_MYSQL $EXT_ARGV -ssE -e 'show /*!50000 ENGINE*/ NDB STATUS' 2>/dev/null
}
collect_mysql_processlist () {
$CMD_MYSQL $EXT_ARGV -ssE -e 'SHOW FULL PROCESSLIST' 2>/dev/null
}
@@ -223,6 +227,7 @@ collect_mysql_info () {
collect_mysql_plugins > "$dir/mysql-plugins"
collect_mysql_slave_status > "$dir/mysql-slave"
collect_mysql_innodb_status > "$dir/innodb-status"
collect_mysql_ndb_status > "$dir/ndb-status"
collect_mysql_processlist > "$dir/mysql-processlist"
collect_mysql_users > "$dir/mysql-users"

View File

@@ -557,6 +557,14 @@ format_innodb_status () {
fi
}
format_ndb_status() {
local file=$1
[ -e "$file" ] || return
# We could use "& \n" but that does not seem to work on bsd sed.
egrep '^[ \t]*Name:|[ \t]*Status:' $file|sed 's/^[ \t]*//g'|while read line; do echo $line; echo $line | grep '^Status:'>/dev/null && echo ; done
}
# Summarizes per-database statistics for a bunch of different things: count of
# tables, views, etc. $1 is the file name. $2 is the database name; if none,
# then there should be multiple databases.
@@ -1410,6 +1418,14 @@ report_mysql_summary () {
fi
fi
# ########################################################################
# NDB
# ########################################################################
if [ -s "$dir/ndb-status" ]; then
section "NDB"
format_ndb_status "$dir/ndb-status"
fi
# ########################################################################
# MyISAM
# ########################################################################