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

zabbix postgresql monitor

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.0.1, 5.0.2
    • Agent (G)
    • None
    • OS:CentOS Linux release 7.8.2003 (Core)
      Zabbix:zabbix_server (Zabbix) 5.0.1
      Revision c2a0b03480 25 May 2020, compilation time: Jul 1 2020 21:47:31
      PostgreSQL:postgresql12-server-12.3-5PGDG.rhel7.x86_64

      Steps to reproduce:

      1. use https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql to monitor postgresql
      2. use template Template DB PostgreSQL
      3. some items is unsupport 
      4. found some errors in zabbix server logs

      Result:

      29128:20200702:014602.151 item "Zabbix server:pgsql.dbstat.tup_fetched.rate["zabbix"]" became not supported: Preprocessing failed for: psql:/var/lib/zabbix/postgresql/pgsql.dbstat.sql:17: ERROR:  field name must not be null
      1. Failed: cannot extract value from json by path "$['zabbix'].tup_fetched": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'psql:/var/lib/zabbix/postgresql/pgsql.dbstat.sql:17: ERROR:  field name must not be null'
       29128:20200702:014602.151 item "Zabbix server:pgsql.dbstat.tup_inserted.rate["zabbix"]" became not supported: Preprocessing failed for: psql:/var/lib/zabbix/postgresql/pgsql.dbstat.sql:17: ERROR:  field name must not be null

      Expected:
      edit the pgsql.dbstat.sql for example ,the issue is solved.

      SELECT json_object_agg(datname, row_to_json(T)) FROM (
              SELECT datname,
                              numbackends,
                              xact_commit,
                              xact_rollback,
                              blks_read,
                              blks_hit,
                              tup_returned,
                              tup_fetched,
                              tup_inserted,
                              tup_updated,
                              tup_deleted,
                              conflicts,
                              temp_files,
                              temp_bytes,
                              deadlocks
              FROM pg_stat_database
              WHERE datname is not NULL
      ) T
      

            neogan Andrei Gushchin (Inactive)
            canghai809 canghai809
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: