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

pt-stalk not parsing --config correctly

bardownbardown EntrantInactive User Role Beginner
For instance when using multiple configs, it seems that the LAST config is the only one honored:

pt-stalk --config ./deadlocks.conf,./longquery.conf,./highcnx.conf --dest=/var/lib/mysql/pt-stalk --log=/var/log/mysql/pt-stalk/pt-stalk.log --sleep=30 --defaults-file=/etc/percona-toolkit.conf

output:
2016_04_25_15_51_59 Starting /usr/bin/pt-stalk --function=status --variable=Threads_running --threshold=100 --match= --cycles=5 --interval=1 --iterations= --run-time=30 --sleep=30 --dest=/var/lib/mysql/pt-stalk --prefix= --notify-by-email= --log=/var/log/mysql/pt-stalk/pt-stalk.log --pid=/var/run/pt-stalk.pid --plugin=

In this example, my longquery.conf is not triggering, but if I put it as the last argument in the list of configs, it does:
[[email protected] configs]# pt-stalk --config ./deadlocks.conf,./highcnx.conf,./longquery.conf --dest=/var/lib/mysql/pt-stalk --log=/var/log/mysql/pt-stalk/pt-stalk.log --sleep=30 --defaults-file=/etc/percona-toolkit.conf
2016_04_25_15_52_46 Starting /usr/bin/pt-stalk --function=/usr/local/bin/mysql/pt-stalk/functions/longquery.sh --variable=Long_Query --threshold=0 --match= --cycles=5 --interval=1 --iterations= --run-time=30 --sleep=30 --dest=/var/lib/mysql/pt-stalk --prefix= --notify-by-email= --log=/var/log/mysql/pt-stalk/pt-stalk.log --pid=/var/run/pt-stalk.pid --plugin=
2016_04_25_15_53_52 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long_Query)=1, matched=yes, cycles_true=1
2016_04_25_15_53_53 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long_Query)=1, matched=yes, cycles_true=2
2016_04_25_15_53_54 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long_Query)=1, matched=yes, cycles_true=3
2016_04_25_15_53_55 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long_Query)=1, matched=yes, cycles_true=4
2016_04_25_15_53_56 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long_Query)=1, matched=yes, cycles_true=5
2016_04_25_15_53_56 Collect 1 triggered
2016_04_25_15_53_56 Collect 1 PID 50385
2016_04_25_15_53_56 Collect 1 done
2016_04_25_15_53_56 Sleeping 30 seconds after collect

Version:
pt-stalk 2.2.7 & 2.2.17

I would expect the --config file,file,file to trigger off ALL configs, not just the last in the list. An example of one of the configs/functions

configs/longquery.sh:
# Config for Queries running 20m or more
function=/usr/local/bin/mysql/pt-stalk/functions/longquery.sh
variable=Long_Query
threshold=0 # Trigger if counter is >= 1
dest=/var/log/mysql/pt-stalk/
log=/var/log/mysql/pt-stalk.log
pid=/var/run/pt-stalk.pid

function/longquery.sh:
trg_plugin() {
mysqladmin --defaults-file=/etc/percona-toolkit.conf 'processlist' | awk -F\| \
'BEGIN{counter=0} {if ($6 ~ /Query/ && $7 > 60 ) counter++; } END {print counter}'
}
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.