Last active
December 29, 2015 23:39
-
-
Save okisanjp/7744658 to your computer and use it in GitHub Desktop.
Zabbix MySQL Slaveのレプリケーション進捗率簡易版
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
UserParameter=mysql.repl_rate,EXEC=`mysql -e'SHOW SLAVE STATUS\G' | grep "Exec_Master_Log_Pos" | awk {'print $2'}` && READ=`mysql -e'SHOW SLAVE STATUS\G' | grep "Read_Master_Log_Pos" | awk {'print $2'}` && echo "scale=2; $EXEC / $READ" | bc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
一個前のファイルをまだスレーブ側で読んでる時は計算が狂う。Seconds_Behind_Master見るほうがいいかも(率はわからなくなるけど)