[ZBX-21810] PostgreSQL Template does not use macros Created: 2022 Oct 25  Updated: 2024 Apr 10  Resolved: 2023 Oct 20

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent2 plugin (G)
Affects Version/s: 5.0.28
Fix Version/s: None

Type: Problem report Priority: Major
Reporter: Humberto Fraga Assignee: Zabbix Integration Team
Resolution: Fixed Votes: 0
Labels: Agent2, PostgreSQL, plugin
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux Centos 7


Team: Team INT

 Description   

Steps to reproduce:

  1. Installed zabbix-agent2 5.0.28 from zabbix repository
  2. zabbix_agent2.conf has no active parameter related to PostgreSQL
  3. On zabbix-server, the host is associated to the DB PotgreSQL Agent 2 template
  4. The host has also the following macros set:
    1. $PG.HOST = localhost
    2. $PG.URI = postgresql://localhost:5433
    3. $PG.USER = zbx_monitor
    4. $PG.PORT = 5433

Yes, my PostgreSQL is running on the non-default port 5433.

Result:

The discovery rule Database discovery fails with the following error:

 

Connection failed: failed to connect to `host=localhost user=postgres database=postgres`: dial error (dial tcp 127.0.0.1:5432: connect: connection refused).

The same message shows up on the zabbix-agent log.

Additional Info:

On the zabbix-server console, I can run:

zabbix_get -s XXX.XXX.XXX.XXX -k 'pgsql.db.discovery[postgresql://localhost:5433,zbx_monitor,,postgres]'

This command returns the correct discovery value. The zabbix_get command bellow:

zabbix_get -s 10.1.1.10 -k 'pgsql.db.discovery[]'

Gives me the same error above.

I have other hosts running PostgreSQL and zabbix-agent2 version 5.0.1. On those hosts, the monitoring is working fine.

 



 Comments   
Comment by Aleksandre Sebiskveradze [ 2023 Oct 20 ]

Working fine on versions 6 and up.

Generated at Mon Apr 28 09:02:27 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.