Skip to content

Commit 8394fce

Browse files
authored
Update mysqlmonitor.sh
1 parent 508f7b6 commit 8394fce

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mysqlmonitor.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Blog: https://linuxblog.io
77
# ---------------------
88

9-
TITLE="------------------------------- MySQL Monitor v2025.01.27.6 (Press 'q' to exit)"
9+
TITLE="------------------------------- MySQL Monitor v2025.01.27.7 (Press 'q' to exit) -----"
1010

1111
# Define minimum terminal size requirements
1212
MIN_COLS=88 # Minimum number of columns
@@ -113,7 +113,7 @@ while true; do
113113
output=""
114114

115115
# Add MySQL Runtime Metrics header
116-
output+=$'------------------------------- MySQL Runtime Metrics\n'
116+
output+=$'------------------------------- MySQL Runtime Metrics -------------------------------\n'
117117

118118
# Capture MySQL status and append to output
119119
mysql_data=$(get_mysql_status | awk '
@@ -340,7 +340,7 @@ while true; do
340340
}
341341
342342
# Additional Metrics section
343-
output = output sprintf("\n------------------------------- MySQL Health Metrics\n")
343+
output = output sprintf("------------------------------- MySQL Health Metrics --------------------------------\n")
344344
345345
# Moved Queries per Second
346346
# Removed the following block to eliminate the separate "Queries per Second" line
@@ -379,7 +379,7 @@ while true; do
379379
')
380380

381381
# Append newline
382-
output+="${mysql_data}"$'\n'
382+
output+="${mysql_data}"$'\n------------------------------- System Memory ---------------------------------------'
383383

384384
# System Memory Section
385385
mem_raw=$(free -b | awk '/Mem:/ {print $2, $3, $4, $7}')
@@ -403,12 +403,12 @@ while true; do
403403
is_low_mem=$(awk "BEGIN {print ($avail_mem_percentage < 10)}")
404404

405405
if (( is_low_mem )); then
406-
mem_info="System Memory: ${mem_total_gb} GB, Used: ${mem_used_gb} GB, Free: ${mem_free_gb} GB, Available: ${mem_avail_gb} GB \033[0;31m(Warning!: ${avail_mem_percentage}%%)\033[0m"
406+
mem_info="${mem_total_gb} GB, Used: ${mem_used_gb} GB, Free: ${mem_free_gb} GB, Available: ${mem_avail_gb} GB \033[0;31m(Warning!: ${avail_mem_percentage}%%)\033[0m"
407407
else
408-
mem_info="System Memory: ${mem_total_gb} GB, Used: ${mem_used_gb} GB, Free: ${mem_free_gb} GB, Available: ${mem_avail_gb} GB"
408+
mem_info="${mem_total_gb} GB, Used: ${mem_used_gb} GB, Free: ${mem_free_gb} GB, Available: ${mem_avail_gb} GB"
409409
fi
410410
# Append mem_info with an empty line before it
411-
output+=$'\n'"${mem_info}"$'\n\n'
411+
output+=$'\n'"${mem_info}"$'\n'
412412

413413
# Add title followed by a newline
414414
output+="${TITLE}"$'\n'

0 commit comments

Comments
 (0)