Updated bash libraries

This commit is contained in:
Carlos Salguero
2018-04-03 16:37:40 -03:00
parent 59c331d14f
commit 6e96a1123c
2 changed files with 103 additions and 9 deletions

View File

@@ -1377,7 +1377,7 @@ pretty_print_cnf_file () {
perl -n -l -e '
my $line = $_;
if ( $line =~ /^[ \t]*[a-zA-Z[]/ ) {
if ( $line =~ /^\s*[a-zA-Z[]/ ) {
if ( $line=~/\s*(.*?)\s*=\s*(.*)\s*$/ ) {
printf("%-35s = %s\n", $1, $2)
}
@@ -1390,6 +1390,7 @@ pretty_print_cnf_file () {
}
find_checkpoint_age() {
local file="$1"
awk '
@@ -1579,6 +1580,13 @@ format_innodb_status () {
fi
}
format_ndb_status() {
local file=$1
[ -e "$file" ] || return
egrep '^[ \t]*Name:|[ \t]*Status:' $file|sed 's/^[ \t]*//g'|while read line; do echo $line; echo $line | grep '^Status:'>/dev/null && echo ; done
}
format_overall_db_stats () {
local file="$1"
local tmpfile="$PT_TMPDIR/format_overall_db_stats.tmp"
@@ -2192,7 +2200,6 @@ parse_wsrep_provider_options () {
}
report_jemalloc_enabled() {
local JEMALLOC_STATUS=''
local GENERAL_JEMALLOC_STATUS=0
local JEMALLOC_LOCATION=''
@@ -2209,8 +2216,6 @@ report_jemalloc_enabled() {
done
if [ $GENERAL_JEMALLOC_STATUS = 1 ]; then
# Check location for libjemalloc.so.1
#for libjemall in "${SCRIPT_PWD}/lib/mysql" "/usr/lib64" "/usr/lib/x86_64-linux-gnu" "/usr/lib"; do
for libjemall in "/usr/lib64" "/usr/lib/x86_64-linux-gnu" "/usr/lib"; do
if [ -r "$libjemall/libjemalloc.so.1" ]; then
JEMALLOC_LOCATION="$libjemall/libjemalloc.so.1"
@@ -2240,7 +2245,6 @@ report_mysql_summary () {
section_mysqld "$dir/mysqld-executables" "$dir/mysql-variables"
section_slave_hosts "$dir/mysql-slave-hosts"
local user="$(get_var "pt-summary-internal-user" "$dir/mysql-variables")"
local port="$(get_var port "$dir/mysql-variables")"
local now="$(get_var "pt-summary-internal-now" "$dir/mysql-variables")"
@@ -2308,8 +2312,7 @@ report_mysql_summary () {
section "Plugins"
name_val "InnoDB compression" "$(get_plugin_status "$dir/mysql-plugins" "INNODB_CMP")"
local has_query_cache=$(get_var have_query_cache "$dir/mysql-variables")
if [ "$has_query_cache" = 'YES' ]; then
if [ "$(get_var have_query_cache "$dir/mysql-variables")" ]; then
section "Query cache"
local query_cache_size=$(get_var query_cache_size "$dir/mysql-variables")
local used=$(( ${query_cache_size} - $(get_var Qcache_free_memory "$dir/mysql-status") ))
@@ -2424,10 +2427,11 @@ report_mysql_summary () {
local innodb_version="$(get_var "innodb_version" "$dir/mysql-variables")"
if [ "${have_innodb}" = "YES" ] || [ -n "${innodb_version}" ]; then
section_innodb "$dir/mysql-variables" "$dir/mysql-status"
if [ -s "$dir/innodb-status" ]; then
format_innodb_status "$dir/innodb-status"
fi
fi
fi
local has_rocksdb=$($CMD_MYSQL $EXT_ARGV -ss -e 'SHOW ENGINES' 2>/dev/null | grep -i 'rocksdb')
if [ ! -z "$has_rocksdb" ]; then
@@ -2435,6 +2439,11 @@ report_mysql_summary () {
section_rocksdb "$dir/mysql-variables" "$dir/mysql-status"
fi
if [ -s "$dir/ndb-status" ]; then
section "NDB"
format_ndb_status "$dir/ndb-status"
fi
section "MyISAM"
section_myisam "$dir/mysql-variables" "$dir/mysql-status"
@@ -2472,6 +2481,7 @@ report_mysql_summary () {
section "Memory management library"
report_jemalloc_enabled
section "The End"
}