Skip to content

Instantly share code, notes, and snippets.

@okisanjp
Last active December 29, 2015 23:39
Show Gist options
  • Save okisanjp/7744658 to your computer and use it in GitHub Desktop.
Save okisanjp/7744658 to your computer and use it in GitHub Desktop.
Zabbix MySQL Slaveのレプリケーション進捗率簡易版
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
@okisanjp
Copy link
Author

okisanjp commented Dec 2, 2013

SQL一発で何とかしたいな・・・

@okisanjp
Copy link
Author

一個前のファイルをまだスレーブ側で読んでる時は計算が狂う。Seconds_Behind_Master見るほうがいいかも(率はわからなくなるけど)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment