[ZBXNEXT-9418] Use consistent macro names in ODBC and agent2 DB templates Created: 2024 Aug 15 Updated: 2024 Nov 19 Resolved: 2024 Sep 29 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Templates (T) |
Affects Version/s: | 7.0.2 |
Fix Version/s: | 6.0.35rc1, 7.0.5rc1, 7.2.0alpha1 |
Type: | Change Request | Priority: | Medium |
Reporter: | Edgars Melveris | Assignee: | Aleksejs Abrosimovs |
Resolution: | Fixed | Votes: | 1 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
||||||||||||||||
Team: | |||||||||||||||||
Story Points: | 1 |
Description |
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. 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}"]
|
Comments |
Comment by Aleksejs Abrosimovs [ 2024 Aug 21 ] |
Although the idea of unifying {$PG.CONNSTRING} macros from different templates sounds appealing, it is impossible to implement it without neglecting the possibility of using secure connections to a database or other optional connection parameters. The difference in possible content for both variants of {$PG.CONNSTRING} is too significant to unify them. As a possible solution for bulk host macro management and for distinguishing one host type macro from another, you can separate Agent 2 and ODBC macros. As an example: export these two templates, find all {$PG.CONNSTRING} and replace it to {$PG.CONNSTRING.ODBC} in ODBC template and {$PG.AGENT2.CONNSTRING} in Agent 2 template. And import them back.
|
Comment by Kim Anthonisen [ 2024 Aug 27 ] |
The idea is not to unify them, but that the templates use different macro names, since the usage/content is different |
Comment by Kim Anthonisen [ 2024 Aug 27 ] |
The workaround is not usable, as it effectively prevents us from updating the templates with new releases from Zabbix |
Comment by Aleksejs Abrosimovs [ 2024 Sep 12 ] |
Available in:
|