Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-9418

Use consistent macro names in ODBC and agent2 DB templates

XMLWordPrintable

    • 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}"]
      

            abrosimovs Aleksejs Abrosimovs
            zux Edgars Melveris
            Team INT
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: