[ZBX-22100] Trigger's event name doesn't work Created: 2022 Dec 15  Updated: 2023 Feb 20

Status: Reopened
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 6.2.6
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Andrea Marconi Assignee: Bartosz Mickiewicz (Inactive)
Resolution: Unresolved Votes: 1
Labels: eventname, items, templates, triggers
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Ubuntu 20.04
Zabbix Server: 6.2.4


Attachments: PNG File Event Trigger.png     PNG File Test.png     PNG File image-2023-02-20-10-12-54-873.png     File zbx_export_templates.yaml    

 Description   

Good afternoon,
I have found a problem about trigger's event name.

I have a trigger which is definedin a template: it checks the value of an item (it must be different from 1).
I have to use {?last(//obj_name-0)} as expression macro because the trigger is definied in a template and so I can't use {?last(/host/obj_name-0)}.

 

Event name Object status NOT OK ({?last(//obj_name-0)})
Expression of trigger​   last(/Template_Example/obj_status-0)<>1

 

 

Then I apply the template to n-hosts...

The trigger fires on host X, I get the result of the attached image: the expression macro returns the value equivalent to {ITEM.LASTVALUE} instead of the value of the expression macro!

Obviusly if I create a clone of the templated item/trigger and then I specify the name of the host in the expression macro of event name ({?last(/host/obj_name-0)}), it will works.

I hope someone could help.



 Comments   
Comment by Andrea Marconi [ 2022 Dec 16 ]

I would like to state that I had also used {?last(/{HOST.HOST}/obj_name-0)}, but I didn't fix the problem.

Comment by Bartosz Mickiewicz (Inactive) [ 2022 Dec 23 ]

Hi, could you provide export of the faulty template?

Comment by Andrea Marconi [ 2022 Dec 23 ]

Good morning, I will attach a random template, for example "Linux Template OS Linux by Zabbix agent" (zbx_export_templates.yaml).

The problem isn't linked to the template, because it appears everytime I create a test "item" in whichever template.

The trigger to search in the template is called "Test".

I have tried to do something "strange" because in this way you could see the problem easily. The image below shows memory usage (you can see it as operational data), but the value is equivalent to {ITEM.LASTVALUE} instead of the value of the expression macro {?last(//system.sw.os)}'.

The problem name should be "Test: Linux version 4.15.0-197-generic (buildd@lcy02-amd64-110) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022".

 

 

 

Regards,

Andrea.

Comment by Bartosz Mickiewicz (Inactive) [ 2023 Feb 17 ]

Sorry for the late response, by any chance did you test this in other versions of Zabbix? Since you want to get an item from the template you have to refer to it using {?last(/templatename/system.sw.os)}

Comment by Andrea Marconi [ 2023 Feb 20 ]

No problem.
I didn't test it in other versions of Zabbix.
Also, I tried to refer to the item using {?last(/templatename/system.sw.os)}, but I have this result:

 

Regards

Generated at Fri Apr 18 21:03:07 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.