[ZBX-18292] Postgresql monitoring using zabbix agent2 broke in 5.0.2 Created: 2020 Aug 25  Updated: 2024 Apr 10  Resolved: 2020 Nov 23

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 5.0.2, 5.0.3
Fix Version/s: 5.4 (plan)

Type: Problem report Priority: Trivial
Reporter: Alexander Yagupov Assignee: Aleksandrs Larionovs (Inactive)
Resolution: Won't fix Votes: 1
Labels: items
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

SLES 15.1


Attachments: PNG File 1.PNG     PNG File 2.PNG     PNG File 3.PNG     PNG File Items_Postgresql.PNG     PNG File Macros_pgsql.PNG     Text File Zabbix_server_conf_PGSQL.txt     PNG File screenshot-1.png     PNG File screenshot-2.png     PNG File screenshot-3.png     PNG File screenshot-4.png     PNG File screenshot-5.png     PNG File screenshot-6.png     File zabbix_agent2.conf     File zabbix_agent2.log-20201101.xz     File zabbix_server.log-20201101.xz    
Issue Links:
Duplicate
is duplicated by ZBX-18319 PostgreSQL monitoring using zabbix-ag... Closed
is duplicated by ZBX-18661 PostgreSQL monitoring using zabbix-ag... Closed
Sub-task
depends on ZBXCTR-13 Add custom query support for PostgreS... Closed
Team: Team INT
Sprint: Sprint 70 (Nov 2020)
Story Points: 1

 Description   

После обновления на версии 5.0.2 и 5.0.3 не полностью работает мониторинг Postgresql
zabbix agent 2. часть элементов данных в статусе не поддерживается с ошибкой - the only supported schemes are: tcp and unix.
После отката zabbix agent 2 на версию 5.0.1, работоспособность восстанавливается.
Используется официальный шаблон: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql
Не поддерживаемые элементы данных во вложении.



 Comments   
Comment by Alexander Yagupov [ 2020 Aug 26 ]

Прошу прощения ошибся со ссылкой на шаблон. Правильная ссылка - https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql_agent2. Именно zabbix-agent2/

Comment by dimir [ 2020 Aug 28 ]

This issue tracker is international and the language is English. Please provide the translation of the description in English so we can replace current one with it.

Comment by Alexander Yagupov [ 2020 Aug 29 ]

Sorry for my English. The problem is as follows. In zabbix versions 5.0.2 and 5.0.3, Postgresql database monitoring using the official template using zabbix agent 2 is partially disabled. When zabbix agent 2 is rolled back to version 5.0.1, it is restored. Some of the data elements in the status are not supported with an error - the only supported schemes are: tcp and unix.

Comment by Alexander Yagupov [ 2020 Oct 12 ]

zabbix-agent2 version 5.0.4 is still broken.

Comment by Alexander Yagupov [ 2020 Nov 15 ]

zabbix-agent2 version 5.0.5 is still broken.

Comment by Aleksandrs Larionovs (Inactive) [ 2020 Nov 18 ]

a.yagupov can you please provide your current connection string that does not work for you.

Comment by Alexander Yagupov [ 2020 Nov 18 ]

Hello. Unfortunately, at the moment, I have to use the working version of zabbix-agent 2 5.0.1 and I can't reproduce this error, but all the information is in ZBX-18292 and ZBX-18319. By the current version 5.0.5, nothing has changed since then.

Comment by Aleksandrs Larionovs (Inactive) [ 2020 Nov 18 ]

a.yagupov could you provide an example of your agent2 configuration file or connection string used to connect to the database?

Comment by Alexander Yagupov [ 2020 Nov 19 ]

Hello. Uploaded files. Is that what you mean? Connecting to the database via pgbouncer port 6452. Database with TimescaleDB.

Comment by Aleksandrs Larionovs (Inactive) [ 2020 Nov 19 ]

Thank you a.yagupov, can you also check the logs of Agent2 what error is displayed during the connection?

Comment by Alexander Yagupov [ 2020 Nov 19 ]

I can't play back entries in the zabbix-server log because I have now rolled back to zabbix-agent 2 version 5.0.1(which has no errors). However, you can view the log entries in ZBX-18319. they are the same as I had when trying to update to version 5.0.2-5.0.5.

Comment by Alexander Yagupov [ 2020 Nov 19 ]

Found. The information you are interested in is in these files on October 28 between 12.00-13.00

Comment by Aleksandrs Larionovs (Inactive) [ 2020 Nov 20 ]

a.yagupov could you try updating agent and updating template to the latest version from git? https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql_agent2/template_db_postgresql_agent2.xml?at=refs%2Fheads%2Frelease%2F5.0

Comment by Alexander Yagupov [ 2020 Nov 20 ]

So far, I just connected a new template, without updating zabbix-agent 2 from version 5.0.1 to version 5.0.5. Now I'll post the errors.
In log zabbix server:
1674:20201120:083240.515 item "Zabbix server:pgsql.bgwriter.sync_time.rate" became not supported: Preprocessing failed for: {"checkpoints_timed":87,"checkpoints_req":0,"checkpoint_write_time":281566856,"checkpoint_sync_ti...
1. Failed: cannot extract value from json by path "$.sync_time": no data matches the specified path
1671:20201120:083244.527 item "Zabbix server:pgsql.dbstat.sum.checksum_failures.rate" became not supported: Value "ZBX_NOTSUPPORTED: Checksum failures metric is supported only in PostgreSQL 12 or higher." of type "string" is not suitable for value type "Numeric (float)"
1677:20201120:083544.018 item "Zabbix server:pgsql.dbstat.checksum_failures.rate["zabbix"]" became not supported: Value "ZBX_NOTSUPPORTED: Checksum failures metric is supported only in PostgreSQL 12 or higher." of type "string" is not suitable for value type "Numeric (float)"
1735:20201120:083833.250 sending configuration data to proxy "zproxy-net.meteorf.ru" at "10.1.152.164", datalen 933417
1727:20201120:084016.554 sending configuration data to proxy "service0.icex.md.meteorf.ru" at "10.1.11.196", datalen 74699
1673:20201120:084140.938 error reason for "Zabbix server:pgsql.bgwriter.sync_time.rate" changed: Preprocessing failed for: {"checkpoints_timed":87,"checkpoints_req":0,"checkpoint_write_time":284986163,"checkpoint_sync_ti...
1. Failed: cannot extract value from json by path "$.sync_time": no data matches the specified path
1726:20201120:084146.653 sending configuration data to proxy "zproxy-sc.meteorf.ru" at "10.1.152.163", datalen 984791
1734:20201120:084304.029 sending configuration data to proxy "zproxy-hpc5.meteorf.ru" at "10.1.176.30", datalen 525799
1729:20201120:084339.205 sending configuration data to proxy "san-mgmt.dom.meteorf.ru" at "10.1.152.10", datalen 315917
1725:20201120:084405.435 sending configuration data to proxy "zproxy-dmz.meteorf.ru" at "10.1.172.5", datalen 201008
1675:20201120:084440.435 error reason for "Zabbix server:pgsql.bgwriter.sync_time.rate" changed: Preprocessing failed for: {"checkpoints_timed":88,"checkpoints_req":0,"checkpoint_write_time":284986163,"checkpoint_sync_ti...
1. Failed: cannot extract value from json by path "$.sync_time": no data matches the specified path

Comment by Alexander Yagupov [ 2020 Nov 20 ]

Not worked items:
Checkpoint: Checkpoint sync time
Dbstat: Checksum failures

Comment by Alexander Yagupov [ 2020 Nov 20 ]

After upgrading zabbix-agent 2 to version 5.0.5

Comment by Aleksandrs Larionovs (Inactive) [ 2020 Nov 20 ]

Can you run in psql select sum(checksum_failures ) FROM pg_catalog.pg_stat_database;

and show the results?

Comment by Alexander Yagupov [ 2020 Nov 20 ]

zabbix2020:/etc/zabbix # sudo -u postgres psql zabbix
psql (13.0, server 12.3)
Type "help" for help.
zabbix=# select sum(checksum_failures ) FROM pg_catalog.pg_stat_database;
sum


(1 row)
zabbix=# \q
zabbix2020:/etc/zabbix # sudo -u postgres psql
psql (13.0, server 12.3)
Type "help" for help.
postgres=# select sum(checksum_failures ) FROM pg_catalog.pg_stat_database;
sum


(1 row)
Get dbstat sum

{"numbackends":15,"xact_commit":12546849,"xact_rollback":96574,"blks_read":14089376,"blks_hit":1564703045,"tup_returned":3708916456,"tup_fetched":535633456,"tup_inserted":52334849,"tup_updated":7707677,"tup_deleted":542202,"conflicts":0,"temp_files":12,"temp_bytes":1446313984,"deadlocks":0,"checksum_failures":null,"blk_read_time":0,"blk_write_time":0}

In items Checkpoint: Checkpoint sync time JSONPath must be $.checkpoint_sync_time

Comment by Alexander Yagupov [ 2020 Nov 20 ]

In the old template for item PostgreSQL statistical: Checksum failure, the preprocessing was

In this template for item PostgreSQL statistical: Checksum failure preprocessing

Comment by Alexander Yagupov [ 2020 Nov 20 ]

In General, everything worked for me. You need to finish the template to make it work for others. But I have another question. I can't force zabbix-agent 2 to work through pgbouncer port 6432? In the config, the agent ignores Plugins. Postgres. Post=6432. The macro in the {$PG.URI} unix template:///var/run/postgresql/PGSQL:6432 is also ignored.

Comment by Aleksandrs Larionovs (Inactive) [ 2020 Nov 23 ]

a.yagupov thank you for your feedback. The port issue will be resolved in ZBXCTR-13

Generated at Sat Dec 13 21:49:45 EET 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.