-
New Feature Request
-
Resolution: Fixed
-
Trivial
-
2.5.0
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 :
- look up basic macro on the host level, then context macro on the template level, then basic macro on the template level etc
- look up context macro on template level, then global level, then basic macro on host level etc
- is duplicated by
-
ZBXNEXT-2745 Add optional user macro parameter
- Closed
-
ZBX-10014 Corruped trigger prototype dependency expression when exporting host/template
- Closed
-
ZBX-9821 $1 in item names expanded incorrectly for item keys containing macros
- Closed