Wrap pt-stalk to collect forensic data about MySQL when problems occur
The run-pt-stalk
wrap the pt-stalk script, run with:
git clone https://github.com/arstercz/system_report.git
cd system_report
./run-pt-stalk interface mysql_port
you can change user and password in run-pt-stalk
file, and the value shoule be in base64 format:
32 "[client]" \
33 "user=$(echo -n eHh4eHh4 | base64 -d)" \
34 "password=$(echo -n eHh4eHh4 | base64 -d)" \
Everyone can change for following code in pt-stalk script to send mail:
1319 echo "$msg on $(hostname)" \
1320 | mail -r '[email protected]' -S smtp='127.0.0.1' -s "Collect triggered on $(hostname)" \
1321 "$OPT_NOTIFY_BY_EMAIL"
pt-stalk use mail
command, we can change the sender and smtp server by
-r
and -S
options.
pt-stalk support the plugin so that we can change the problems occur's conditions. Example in the plugin dirs is to summary the cpu by the all MySQL process used.
all self-defined function should be named trg_plugin
.
We had fixed the following bugs:
and add the following features:
1. capture traffic by use tcpdump;
2. output numa information;
3. record mysql process oom_score