From a77b68ed73f46c8bf7c957acc4861d927ea4c4e0 Mon Sep 17 00:00:00 2001 From: Fernando Ipar Date: Tue, 10 Oct 2017 10:43:58 -0300 Subject: [PATCH] Improved formatting of the ndb status a bit --- bin/pt-mysql-summary | 2 +- lib/bash/report_mysql_info.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/pt-mysql-summary b/bin/pt-mysql-summary index fd51f7e1..b165e805 100755 --- a/bin/pt-mysql-summary +++ b/bin/pt-mysql-summary @@ -1586,7 +1586,7 @@ format_ndb_status() { local file=$1 [ -e "$file" ] || return - cat "$file" + egrep '^[ \t]*Name:|[ \t]*Status:' ndb_status.txt|sed 's/^[ \t]*//g'|while read line; do echo $line; echo $line | grep '^Status:'>/dev/null && echo ; done } format_overall_db_stats () { diff --git a/lib/bash/report_mysql_info.sh b/lib/bash/report_mysql_info.sh index 02839527..9bb6dfb6 100644 --- a/lib/bash/report_mysql_info.sh +++ b/lib/bash/report_mysql_info.sh @@ -561,8 +561,8 @@ format_ndb_status() { local file=$1 [ -e "$file" ] || return - # at the time being, just cat the file. - cat "$file" + # We could use "& \n" but that does not seem to work on bsd sed. + egrep '^[ \t]*Name:|[ \t]*Status:' ndb_status.txt|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