LP #1194874: pt-stalk should capture show slave status

Description

**Reported in Launchpad by Fernando Ipar last update 02-08-2013 18:34:07

This is a feature request.
pt-stalk should capture the output to 'show slave status\G' when collect is triggered, if running on a replication slave.

Environment

None

Smart Checklist

Activity

Show:

lpjirasync January 24, 2018 at 7:38 PM

**Comment from Launchpad by: Daniel Nichter on: 02-08-2013 18:33:47

I agree, this would be useful. Created https://blueprints.launchpad.net/percona-toolkit/+spec/pt-stalk-collect-show-slave-status for this feature.

lpjirasync January 24, 2018 at 7:38 PM

**Comment from Launchpad by: Fernando Ipar on: 27-06-2013 19:11:51

Fact is, this would take of 1050497 too.

=== modified file 'lib/bash/collect.sh'
— lib/bash/collect.sh 2013-03-12 21:23:02 +0000
+++ lib/bash/collect.sh 2013-06-27 19:11:16 +0000
@@ -222,6 +222,14 @@
(echo $ts; netstat -antp) >> "$d/$p-netstat" &
(echo $ts; netstat -s) >> "$d/$p-netstat_s" &

+ if [ -n "$($CMD_MYSQL $EXT_ARGV -e 'show slave status\G')" ]; then
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW SLAVE STATUS\G") \ >> "$d/$p-slave-status" &
+ fi
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW MASTER LOGS\G") \ >> "$d/$p-master-logs" &
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW MASTER STATUS\G") \ >> "$d/$p-master-status" &
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \ >> "$d/$p-processlist" &

lpjirasync January 24, 2018 at 7:38 PM

**Comment from Launchpad by: Fernando Ipar on: 27-06-2013 19:04:14

I believe the following should do this:

=== modified file 'lib/bash/collect.sh'
— lib/bash/collect.sh 2013-03-12 21:23:02 +0000
+++ lib/bash/collect.sh 2013-06-27 19:02:03 +0000
@@ -222,6 +222,10 @@
(echo $ts; netstat -antp) >> "$d/$p-netstat" &
(echo $ts; netstat -s) >> "$d/$p-netstat_s" &

+ if [ -n "$($CMD_MYSQL $EXT_ARGV -e 'show slave status\G')" ]; then
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW SLAVE STATUS\G") \ >> "$d/$p-slave-status" &
+ fi
(echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \ >> "$d/$p-processlist" &

Not a Bug

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 7:37 PM
Updated February 3, 2018 at 9:27 PM
Resolved January 24, 2018 at 7:38 PM