Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-247

pt-stalk multiple config issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 3.0.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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. 

      The setup:
      
      Directories:
      - configs
      - functions
      
      
      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}'
      }
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            carlos.salguero Carlos Salguero
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Smart Checklist