在进行mysql 故障问题处理的时候,我们一般第一个先看 show processlist,对结果进行分析,有的时候,人工分析需要时间,本脚本能自动分析原因,给出相关建议,可以输出满查询以及长事务的信息,并能远程kill。action 可以show proceslist 可以check分析当前mysql链接的状态以及原因。
https://github.com/baixiaoyu/dbascripts/blob/main/myanalyzer.py
python myanalyzer.py --help
usage: myanalyzer.py -t 5 -i 192.168.0.0.1
optional arguments:
-h, --help show this help message and exit
-a ACTION, --action ACTION
show or check.
-n TOPN, --topn TOPN show topn long query or big transaction record.
-t TIME, --time TIME check thread which time greater than t.
-i IP, --ip IP server ip.
-P PORT, --port PORT server port.
-c CONFIG, -