-
Change Request
-
Resolution: Unresolved
-
Medium
-
None
-
None
The documentation https://www.zabbix.com/documentation/current/manual/config/macros/user_macros explains how Zabbix resolves macros. In most cases this may be sufficient. But sometimes one needs more control to define the precedence of macros defined in templates.
Example situation:
- Main OS template "Linux" for each Linux host.
- Separate template for "SLES" which inherits from "Linux" and has:
- Additional items and triggers
- Some macros set to a different value, for example:
- {$NTP_SERVICE_NAME} set to "ntp"
- Template for NTP service which is named "ntp" or "ntpd" on different Linux distributions.
- Linked directly to the host
- Macro {$NTP_SERVICE_NAME} set to "ntp"
- Item service.status[\{$NTP_SERVICE_NAME}]
- The resolved macro value will depend on the template ID which one cannot change. So in some cases it will have the expected value and in some it won't.
So I think it's important to add the ability to have more control on it. One option could be adding a priority to macros defined in templates. Default will be "0" which would result in the current behaviour. If one sets a macro's priority >0 the one with the highest priority should have precedence.