原文鏈接:https://github.com/open-falcon/mymon
Introduction
mymon(MySQL-Monitor) -- MySQL數據庫運行狀態數據采集腳本,采集包括global status, global variables, slave status等。
Installation
#set $GOPATH and $GOROOT
mkdir -p$GOPATH/src/github.com/open-falcon
cd$GOPATH/src/github.com/open-falcon
git clone https://github.com/open-falcon/mymon.git
cd mymon
go get ./...
go build -o mymonecho'* * * * * cd $GOPATH/src/github.com/open-falcon/mymon && ./mymon -c etc/mon.cfg'>/etc/cron.d/mymon
Configuration
? ? [default]
? ? log_file=mymon.log # 日志路徑和文件名
? ? # Panic 0
? ? # Fatal 1
? ? # Error 2
? ? # Warn 3
? ? # Info 4
? ? # Debug 5
? ? log_level=4 # 日志級別
? ? falcon_client=http://127.0.0.1:1988/v1/push # falcon agent連接地址
? ? #自定義endpoint
? ? endpoint=127.0.0.1 #若不設置則使用OS的hostname
? ? [mysql]
? ? user=root # 數據庫用戶名
? ? password= # 數據庫密碼
? ? host=127.0.0.1 # 數據庫連接地址
? ? port=3306 # 數據庫端口
請參考./metrics.txt,其中的內容,僅供參考,根據MySQL的版本、配置不同,采集到的metrics也有差別。