ExportXMLWordPrintable

    • 3

      Steps to reproduce:

      1. Install Zabbix Server (any version, 7.0.27 used for testing)
      2. Add a host with "PostgreSQL by Zabbix agent 2" template
      3. Add 2 physical replication instances to the host using the same application name
      4. Trigger "Replication Discovery"

      Result:
      The template will only discover one replication application, the other one will create a conflict because it has the same name
      Expected:
      The {#APPLICATION_NAME} macro should not depend only on application_name from pg_stat_replication since it's not a unique identifier. In fact there's an inconcistency with the documentation which says:

      pgsql.replication.process.discovery[uri,username,password] - replication procces name discovery. Returns: Result of the

      SELECT 
      json_build_object('data',
      json_agg(json_build_object('{#APPLICATION_NAME}',
      CONCAT(application_name, ' ', pid))))       
      FROM 
      pg_stat_replication

       

      When in reality, the query that's being executed according to handler_replication_process_name_discovery.go:31 is:

       

      query := `SELECT 
       json_build_object('data',COALESCE(json_agg(json_build_object('{#APPLICATION_NAME}',application_name)), '[]')) 
       FROM pg_stat_replication`

       

      The correct approach should be the one already stated in the documentation where the pid is concatenated to the name of the application in the macro

        1. zabbix.png
          zabbix.png
          26 kB
        2. screenshot-1.png
          screenshot-1.png
          236 kB
        3. zbx-27876-22oct-1.png
          zbx-27876-22oct-1.png
          193 kB
        4. zbx-27876-22oct-2.png
          zbx-27876-22oct-2.png
          173 kB
        5. zbx-27876-23oct-1.png
          zbx-27876-23oct-1.png
          148 kB

            Assignee:
            Martins Valkovskis
            Reporter:
            Carlos Chapi
            Team INT
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 78.5h
                78.5h