pt-stalk should capture show slave status

Bug #1194874 reported by Fernando Ipar
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Invalid
Undecided
Unassigned

Bug Description

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.

Tags: pt-stalk
Revision history for this message
Fernando Ipar (fipar) wrote :

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" &

Revision history for this message
Fernando Ipar (fipar) wrote :

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" &

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :
tags: added: pt-stalk
Changed in percona-toolkit:
status: New → Invalid
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1128

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers