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

    • Team INT
    • Sprint 90 (Jul 2022)
    • 0.5

      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: 
       

       

            drasikhov Denis Rasikhov
            splitek Adam Splitt
            Team INT
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: