Github主页:
https://github.com/dblucyne/dodba_tools
Download:
wget https://raw.githubusercontent.com/dblucyne/dodba_tools/master/doDBA --no-check-certificate
wget https://raw.githubusercontent.com/dblucyne/dodba_tools/master/doDBA.conf --no-check-certificate
chmod +x doDBA
下载下来就可以直接使用,不依赖于任何环境。
使用帮助:
./doDBA -help
Usage: doDBA [OPTIONS]
-help
Display this help.
-c string
configuration file. (default "doDBA.conf")
-h string
Connect to host/IP.
-sys
Print system info.
-myall
Print system and mysql info.
-mysql
Print mysql info.
-innodb
Print innodb info.
-mytop
Print mysql prcesslist info , like top.
-i duration
refresh interval in seconds. (default 1s)
-t int
mysql doing on Threads_running. (default 50)
-hP string
Connect host port. (default "22")
-hp string
Connect host password.
-hu string
Connect host user. (default current user)
-mP string
Connect mysql port. (default "3306")
-mp string
Connect mysql password.
-mu string
Connect mysql user.
-rds
Ignore system info.
-log
Print to file by day.
-nocolor
Print to nocolor.
Configuration
doDBA.conf
{
"Host":"",
"Huser": "root",
"Hport": "22",
"Hpwd": "",
"Muser": "dodba",
"Mpwd": "dodba",
"Mport":"3306"
}
For example:
./doDBA -c=doDBA.conf
例子(-i参数测试不能用)
./doDBA -h 192.168.1.198 -sys
./doDBA -h 192.168.1.198 -myall
./doDBA -h 192.168.1.198 -mysql
./doDBA -h 192.168.1.198 -innodb
./doDBA -h 192.168.1.198 -sys
fangyali@192.168.1.198's password:
DoDBA tools on host 192.168.1.198
---------+----load--avg----+-----cpu-usage-----+--swap--+----net----+-----------IO-----------
time | 1m 5m 10m| usr sys iow ide| si so| recv send| r/s w/s rb/s wb/s
---------+-----------------+-------------------+--------+-----------+------------------------
18:01:33 | 0.17 0.16 0.11| 0.6 0.7 0.8 97.9| 0 0| 12K 43K| 0 179 0K 3.7M
18:01:34 | 0.16 0.16 0.11| 0.5 0.7 0.0 98.8| 0 0| 14K 61K| 1 15 4K 96K
18:01:35 | 0.16 0.16 0.11| 0.5 0.8 0.2 98.6| 0 0| 39K 130K| 0 12 0K 116K
18:01:36 | 0.16 0.16 0.11| 0.5 0.7 0.1 98.7| 0 0| 13K 43K| 1 17 4K 144K
./doDBA -h 192.168.1.198 -myall
fangyali@192.168.1.198's password:
DoDBA tools on host 192.168.1.198
---------+----load--avg----+-----cpu-usage-----+--swap--+----net----+-------mysql-status-------+-slow---th---+---bytes---
time | 1m 5m 10m| usr sys iow ide| si so| recv send| QPS TPS ins upd del| sql run con| recv send
---------+-----------------+-------------------+--------+-----------+--------------------------+-------------+-----------
17:59:20 | 0.17 0.13 0.10| 0.5 0.8 0.0 98.6| 0 0| 14K 8K| 0 4 4 0 0| 0 1 94| 3K 3K
17:59:21 | 0.17 0.13 0.10| 0.5 0.8 0.1 98.6| 0 0| 19K 72K| 0 8 8 0 0| 0 1 94| 4K 3K
17:59:22 | 0.17 0.13 0.10| 0.5 0.7 0.1 98.7| 0 0| 18K 46K| 0 9 8 0 1| 0 1 94| 5K 3K
17:59:23 | 0.17 0.13 0.10| 0.4 0.8 0.1 98.7| 0 0| 18K 46K| 0 11 11 0 0| 0 1 94| 7K 3K
17:59:24 | 0.15 0.13 0.10| 0.5 0.8 0.0 98.7| 0 0| 19K 46K| 65 6 6 0 0| 0 1 94| 14K 42K
17:59:25 | 0.15 0.13 0.10| 0.5 0.7 0.1 98.7| 0 0| 30K 89K| 0 7 7 0 0| 0 1 94| 4K 3K
17:59:26 | 0.15 0.13 0.10| 0.5 0.6 0.1 98.7| 0 0| 16K 46K| 0 3 3 0 0| 0 1 94| 2K 3K
17:59:27 | 0.15 0.13 0.10| 0.5 0.8 0.0 98.7| 0 0| 17K 46K| 1 4 2 2 0| 0 1 94| 2K 150K
./doDBA -h 192.168.1.198 -mysql
DoDBA tools on host 192.168.1.198
---------+-------mysql-status-------+-----threads-----+-----slow-----+---bytes---+---------locks----------
time | QPS TPS ins upd del| run con cre cac| sql tmp Dtmp| recv send| lockI lockW openT openF
---------+--------------------------+-----------------+--------------+-----------+------------------------
17:59:58 | 0 5 3 2 0| 1 94 0 234| 0 1 0| 3K 3K| 5 0 2030 158
17:59:59 | 2 6 3 3 0| 1 94 0 234| 0 1 0| 4K 4K| 8 0 2030 158
18:00:00 | 3 7 6 1 0| 1 94 0 234| 0 2 0| 45K 4K| 12 0 2030 158
18:00:01 | 1 7 7 0 0| 1 94 0 234| 0 1 0| 5K 5K| 7 0 2030 158
./doDBA -h 192.168.1.198 -innodb
DoDBA tools on host 192.168.1.198
---------+------innodb--rows-----+---------innodb--pages--------+-------innodb--data-------+--innodb-log--
time | read ins upd del| data free dirty flush|reads writes read written|fsyncs written
---------+-----------------------+------------------------------+--------------------------+--------------
18:00:50 | 0 4 0 0| 1551153 1 70 0| 0 5 0K 3K| 1 3K
18:00:51 | 2 2 1 0| 1551153 1 7 73| 0 74 0K 2.3M| 3 4K
18:00:52 | 0 0 0 0| 1551153 1 7 0| 0 1 0K 0K| 1 0K
18:00:53 | 0 2 0 0| 1551153 1 12 0| 0 3 0K 2K| 1 2K