Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-5831

pmm-admin does not use 'listen-port' value from the agent config file

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 2.19.0, 2.5.0, 2.6.1, 2.11.1
    • 2.27.0
    • None
    • CentOS Linux release 7.7.1908 (Core)

      Linux 3.10.0-1062.1.1.el7.x86_64 #1 SMP Fri Sep 13 22:55:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

      pmm2-client-2.5.0-6.el7.x86_64

    • 2
    • Yes
    • Yes
    • Yes
    • C/S Core

    Description

      If pmm-agent is configured to use a port different from the default 7777, pmm-admin does not use the value from /usr/local/percona/pmm2/config/pmm-agent.yml file and tries to connect to the default port.

      For example:

      Fragment of the configuration file:

      # Updated by `pmm-agent setup`.
      ---
      id: /agent_id/c575d159-26ea-4a14-8b9e-039413dc7560
      listen-port: 7778

      Ports used by pmm-agent:

       

      $ sudo netstat -tunlp|grep pmm-agent
      tcp 0 0 127.0.0.1:7778 0.0.0.0:* LISTEN 6075/pmm-agent 
      tcp 0 0 127.0.0.1:43510 0.0.0.0:* LISTEN 6075/pmm-agent

      Attempt to check the agent status:

      $ sudo pmm-admin status
      Failed to get PMM Server parameters from local pmm-agent: Post http://127.0.0.1:7777/local/Status: EOF.
      Please use --server-url flag to specify PMM Server URL.

       
      How to test:

      1. Run pmm-agent on different port than 7777 (for example 8000)
      2. Download attached binary of pmm-admin.
      3. Use downloaded pmm-admin 
      4. Add global flag --pmm-agent-listen-port=8000 to your command. For example:

      ./bin/pmm-admin --pmm-agent-listen-port=8000 add postgresql --username=pmm-agent --password=pmm-agent-password --query-source=pgstatmonitor nameofpostgres
      
      

      5. See that command worked.
       

      Suggested solution: 

      Add --pmm-agent-listen-port flag to pmm-admin

      Attachments

        Issue Links

          Activity

            People

              jiri.ctvrtka Jiří Čtvrtka
              minaev Dimitri Minaev
              Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist