-
Problem report
-
Resolution: Duplicate
-
Trivial
-
None
-
6.4.3
-
None
-
GNU/Linux Debian 11
Zabbix server 6.4.3
Zabbix agent2 6.4.3
PostgreSQL 13
Steps to reproduce:
- Import template https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql_agent2?at=refs%2Ftags%2F6.4.3
- Create user in PostgreSQL, check the connection.
- Create host in Zabbix server - link with template PostgreSQL by Zabbix agent 2.
Result:
- All Zabbix agent items and discovery rules are unsupported.
- This errors appears in the Zabbix agent2 log:
zabbix_agent2[1397423]: [PostgreSQL] Connection failed: failed to connect to `host=/run/postgresql user=zabbix database=user=zbx_monitor`: server error (ERROR: no such database: user=zbx_monitor (SQLSTATE 08P01)).
Is trying to use the user as database name.
Expected:
Get info from database.
How to fix:
Define database name in Zabbix agent items and discovery rules key as the last parameter:
Zabbix agent items:
pgsql.archive["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.bgwriter["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.connections["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.dbstat.sum["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.dbstat["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] {{pgsql.locks["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.oldest.xid["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.replication.process["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.uptime["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.wal.stat["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.ping["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"]
Discovery rules:
pgsql.replication.process.discovery["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"] pgsql.db.discovery["\{$PG.URI}","\{$PG.USER}","\{$PG.PASSWORD}","\{$PG.DATABASE}"]
- duplicates
-
ZBX-22868 zabbix-agent2 upgrade breaks postgresql plugin monitoring
- Closed