Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19205

Errors in official Zabbix Template DB PostgreSQL Agent2

    XMLWordPrintable

Details

    • Problem report
    • Status: Confirmed
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • Templates (T)
    • None

    Description

      Official template for PostgreSQL agent 2:

      url: https://www.zabbix.com/integrations/postgresql#tab:official2

      url: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql_agent2

       

      Error 1: Wrong item preprocessing used in item "Dbstat: Blocks write time". Should be $.blk_write_time instead of $.blk_read_time

       

      PostgreSQL Dbstat: Blocks write time Time spent writing data file blocks by backends, in milliseconds DEPENDENT pgsql.dbstat.sum.blk_write_time
       
      Preprocessing:
       
      • JSONPATH: $.blk_read_time
         
      • MULTIPLIER: 0.001

       

      Error 2: Wrong item name for "Disk blocks read per second". See below... two the same item names, but second item name should be "Disk blocks write per second"

       

      PostgreSQL DB {#DBNAME}: Disk blocks read per second Time spent reading data file blocks by backends, in milliseconds DEPENDENT pgsql.dbstat.blk_read_time.rate"{#DBNAME}"
       
      Preprocessing:
       
      • JSONPATH: $'{#DBNAME}'.blk_read_time
         
      • MULTIPLIER: 0.001
         
      • CHANGE_PER_SECOND
      PostgreSQL DB {#DBNAME}: Disk blocks read per second Time spent writing data file blocks by backends, in milliseconds DEPENDENT pgsql.dbstat.blk_write_time.rate"{#DBNAME}"
       
      Preprocessing:
       
      • JSONPATH: $'{#DBNAME}'.blk_write_time
         
      • MULTIPLIER: 0.001
         
      • CHANGE_PER_SECOND

       

      3) Error in "Replication Discovery" LLD macro name. Plugin return {#APPLICATION_NAME}, template uses {#APPLICATION}. Template should use {#APPLICATION_NAME} instead of {#APPLICATION}, because replication discovery failing

      Plugin source line 37: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/src/go/plugins/postgres/handler_replication_process_name_discovery.go

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

       

       

      4) If there is no replication configured in PG, "Replication discovery" throwing error., because key pgsql.replication.process.discovery return JSON like:

       

      {"data" : null}

       

      Steps to reproduce:**

      1. Apply template to host with PG without replication.

      2. Run "Replication discovery" observe errors.

      Expected: Just no errors.

      I suggest to add preprocessing to not get errors:
      "Does not match regular expression" = null, Custom on fail = Discard value.
      Something like: 
       

       

      Attachments

        Activity

          People

            neogan Andrei Gushchin
            splitek Adam Splitt
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: