-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
5.0.1, 5.0.2
-
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:
- use https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql to monitor postgresql
- use template Template DB PostgreSQL
- some items is unsupport
- 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