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

context/parameter for user macros/variables

XMLWordPrintable

      somewhat similar to gettext context, it would be useful to specify context for user macros/variables.

      context could be specified either inside the macro reference or after it :

      • {$NAME[context]}
      • {$NAME}[context]

      macro resolves to the most specific value - if the context is specified, it tries to find a macro with the context value. if there is no macro with such context, it tries to find basic macro.

      one usecase would be lld. diskspace trigger threshold could use a macro {$DISK}. if the lld rule would specify it as :

      • {$DISK}[{#LLD_MACRO}]
        each disk could get this macro with different context, where context would be path, for example {$DISK}[/].
        if there would be a macro like {$DISK}[/] defined, its value would be used. if that would be missing, macro {$DISK} would be used.

      an open question : should context or level gain priority ? as in, if host does not have macro with that context, should we :

      1. look up basic macro on the host level, then context macro on the template level, then basic macro on the template level etc
      2. look up context macro on template level, then global level, then basic macro on host level etc

        1. equivalent-macros.png
          38 kB
          Aleksandrs Saveljevs

            Unassigned Unassigned
            richlv richlv
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: