Collecting metrics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Slave Lag | |
#!/usr/bin/bash | |
log_dir=/logs/ | |
#Slave lag | |
mysql --login-path=mysqlconn -e "show slave status \G" | grep Seconds| awk '{ print $2 }' | while IFS= read -r line; do printf '%s\t%s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line"; done | tee -a $log_dir/slave_lag | |
#Processlist | |
mysql --login-path=mysqlconn -e "show slave status \G" | grep Seconds| awk '{ print $2 }' | while IFS= read -r line; do printf '%s\t%s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line"; done | tee -a $log_dir/slave_lag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment