Unable to get pt-stalk working with multiple config files. For example:
/usr/bin/pt-stalk --config /usr/local/bin/mysql/pt-stalk/configs/idleconnections.conf,/usr/local/bin/mysql/pt-stalk/configs/longquery.conf --dest=/var/lib/mysql/pt-stalk --log=/var/log/mysql/pt-stalk.log --sleep=300 --interval=300 --defaults-file=/etc/percona-toolkit.conf --daemonize
I then replicate an idle connection, and it triggers successfully… when I simulate a long query… it does not. If I reverse the order of the config files:
/usr/bin/pt-stalk --config /usr/local/bin/mysql/pt-stalk/configs/longquery.conf,/usr/local/bin/mysql/pt-stalk/configs/idleconnections.conf --dest=/var/lib/mysql/pt-stalk --log=/var/log/mysql/pt-stalk.log --sleep=300 --interval=300 --defaults-file=/etc/percona-toolkit.conf --daemonize
pt-stalk then triggers on longquery, but not on idleconnections.
Am I missing something?
Could you please share the config files you are using to try to reproduce the issue?
bardown
January 12, 2018, 11:02am
3
Thank you for a response!
The setup:
Directories:
config1: idleconnections.conf
Config for idle connections
function=/usr/local/bin/mysql/pt-stalk/functions/idleconnections.sh
variable=idle_connections
threshold=0
dest=/var/log/mysql/pt-stalk/
log=/var/log/mysql/pt-stalk.log
pid=/var/run/pt-stalk.pid
Content of idleconnections.sh:
trg_plugin() {
mysqladmin --defaults-file=/etc/percona-toolkit.conf ‘processlist’ | awk -F|
‘BEGIN{counter=0} {if ($6 ~ /Sleep/ && $7 > 3600 ) counter++; } END {print counter}’
}
config2: longquery.conf
Config for Queries running long
function=/usr/local/bin/mysql/pt-stalk/functions/longquery.sh
variable=Long_Query
threshold=0
dest=/var/log/mysql/pt-stalk/
log=/var/log/mysql/pt-stalk.log
pid=/var/run/pt-stalk.pid
Content of longquery.sh:
trg_plugin() {
mysqladmin --defaults-file=/etc/percona-toolkit.conf ‘processlist’ | awk -F|
‘BEGIN{counter=0} {if ($6 ~ /Query/ && $7 > 1200 ) counter++; } END {print counter}’
}