Not the answer you need?
Register and ask your own question!


stofa.kenidastofa.kenida ContributorCurrent User Role Novice
Hi There,

I'am testing pt-stalk tool by using 3.0.9 version on 5.5 mysql server version. When i run the command as below :

/usr/bin/pt-stalk --host --port 3355 --mysql-only --daemonize --log /tmp/pt-stalk/pt-stalk.log --dest /tmp/pt-stalk --function status --variable Threads_running --threshold 12 --cycles=10 --sleep=30 --run-time=20 --interval 5 --retention-time 1 --disk-pct-free 10

It seems that mysql-only option is ignored as the generated processlist file is empty. I expected to see the output of SHOW FULL PROCESSLIST in the file named DATA-TIIME-processlist. Instead, by removing --mysql-only option, the file is correctly generated. What is wrong in my command?

Moreover, can pt-stalk be used against old mysql versions ( 5.0 and 4.1.25 ) ?



  • carlos.salguerocarlos.salguero Percona Toolkit Developer Percona Staff Role

    I don't see anything wrong with your command. Maybe it is an error. Could you fill a bug in Jira?
    Regarding MySQL versions, version prior 5.5 are not supported but you can try it anyway. pt-stalk is a bash script that run commands and collect information so it should work.
  • stofa.kenidastofa.kenida Contributor Current User Role Novice
    Ok. Created bug in jira as suggested.

  • stofa.kenidastofa.kenida Contributor Current User Role Novice
    I think the problem is fixed.
    Inside the script, the function called collect() is used to collect all the needed info.
    The following block is used to collect system info only when mysql-only is NOT used.

    while [ $((curr_time - start_time)) -lt $OPT_RUN_TIME ]; do
    if [ ! "$OPT_MYSQL_ONLY" ]; then
    disk_space $d > $d/$p-disk-space
    check_disk_space \
    $d/$p-disk-space \
    || break

    sleep $(date +'%s.%N' | awk "{print $OPT_SLEEP_COLLECT - (\$1 % $OPT_SLEEP_COLLECT)}")
    local ts="$(date +"TS %s.%N %F %T")"

    if [ -d "/proc" ]; then
    if [ -f "/proc/diskstats" ]; then
    (echo $ts; cat /proc/diskstats) >> "$d/$p-diskstats" &
    if [ -f "/proc/stat" ]; then
    (echo $ts; cat /proc/stat) >> "$d/$p-procstat" &
    if [ -f "/proc/vmstat" ]; then
    (echo $ts; cat /proc/vmstat) >> "$d/$p-procvmstat" &
    if [ -f "/proc/meminfo" ]; then
    (echo $ts; cat /proc/meminfo) >> "$d/$p-meminfo" &
    if [ -f "/proc/slabinfo" ]; then
    (echo $ts; cat /proc/slabinfo) >> "$d/$p-slabinfo" &
    if [ -f "/proc/interrupts" ]; then
    (echo $ts; cat /proc/interrupts) >> "$d/$p-interrupts" &
    (echo $ts; df -k) >> "$d/$p-df" &
    (echo $ts; netstat -antp) >> "$d/$p-netstat" &
    (echo $ts; netstat -antp) >> "$d/$p-netstat" &
    (echo $ts; netstat -s) >> "$d/$p-netstat_s" &
    >> "$d/$p-processlist" &

    As you can see, in order to get SHOW FULL PROCESSLIST output, $ts variable is required.

    But the above variable is delared inside the if block, then when mysql-only is used, $ts is NOT set.

    By putting local ts="$(date +"TS %s.%N %F %T")" outside the if block, for instance just under while [ ] do;

    the command is executed and processlist file is populated.

Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.