-
Change Request
-
Resolution: Fixed
-
Medium
-
7.0.2
-
None
-
1
If both templates we use the same macro to define connection details:
{$PG.CONNSTRING}
But in each template we expect different contents for this macro.
It could help management of hosts in situations where both templates could be used for different hosts.
PostgreSQL by Zabbix agent 2
{$PG.CONNSTRING} = tcp://localhost:5432
PostgreSQL by ODBC:
{$PG.CONNSTRING} = Servername=localhost;Port=5432;Driver=/usr/lib64/psqlodbcw.so
For example, if we set macros like {$PG.ADDRESS}, {$PG.PORT} and {$PG.DRIVER}, they could be set universally for all hosts and then each template uses them differently.
Then in agent2 template the key would become:
pgsql.dbstat.sum["tcp://{$PG.ADDRESS}:{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}"]
But on ODBC template:
db.odbc.select[pgsql.dbstat.sum,,"Database={$PG.DATABASE};Servername={$PG.ADDRESS};Port={$PG.PORT};Driver={$PG.DRIVER}"]