-
Type:
Problem report
-
Resolution: Won't fix
-
Priority:
Major
-
None
-
Affects Version/s: 4.0.0rc1
-
Component/s: API (A)
-
None
-
Environment:Zabbix 4.rc1 on CentOs 7
Steps to reproduce:
- Add macros to trigger prototype "Free disk space is less than 20% on volume {#FSNAME}" from "Template OS Linux" => "Discovery rules" => "Mounted filesystem discovery" => "Trigger prototypes"
- MyHost = {HOST.NAME}
- FsName = {#FSNAME}
- MyInvOs = {INVENTORY.OS}
- Make the trigger fire
- Prepare a script calling api "trigger.get" with
{"auth":"xxxxx",
"jsonrpc":"2.0",
"method":"trigger.get",
"params":{
"monitored":"true",
"expandDescription":"true",
"filter":{"value":1},
"expandComment":"true",
"expandExpression":"true",
"selectTags":"extend",
"expandData":"true"},
"id"1}
Result:
Extract from API result showing macros not expanded.
"tags" : [ { "value" : "{INVENTORY.OS}", "tag" : "MyInvOs" }, { "value" : "/boot", "tag" : "FsName" }, { "value" : "{HOST.NAME}", "tag" : "MyHost" }
Expected:
When using an action or in the frontend gui, tags are expanded but not in the API.
Here is the content of the EVENT.TAGS from an action:
MyHost:myhost,MyInvOs:Linux myhost xxxxxxxxx,FsName:/boot
It is not expanded for all macros from https://www.zabbix.com/documentation/4.0/manual/config/event_correlation/trigger/event_tags section "Macro support".
Only User Macro and LLD Macro are expanded on my side in API.