[ZBX-14406] Discovery macros containing empty values treated different in item names and trigger names Created: 2018 May 29  Updated: 2018 Sep 25  Resolved: 2018 Sep 25

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.4.8
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: James Cook Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File discovered-item.png     XML File generate-items-from-trap.xml     PNG File item-prototype.png     PNG File three-items-from-discovery.png    

 Description   

Steps to reproduce:

  1. Create a discovery rule that defines an item and trigger that contains {#MACRO1} in their names ie "This is the name {MACRO1}".
  2. Send a discovery packet where {#MACRO1} contains NULL ie "".
  3. Confirm item and trigger have been created.

 

Result:
You will see that the item name contains "This is the name []" and the trigger name contains "This is the name [ ]" - Ie there is a space in the trigger name as I believe it is not substituted with a NULL and a space instead.

Expected:
What I would expect is the "" is treated the same and the names do no include a space for an empty macro....



 Comments   
Comment by Aigars Kadikis [ 2018 May 29 ]

Just made template generate-items-from-trap.xml (3.0+ compatible) for easier reproduction.

Need to assign to host with the name 'receiver'.

Send a JSON with:

zabbix_sender -z 127.0.0.1 -s receiver -k trap.rule -o '{"data":[{"{#MACRO1}":"space"},{"{#MACRO1}":" "},{"{#MACRO1}":""}]}'

The output will be:

Did not got "item[ ]" (with plain space inside). How did you perform your scenario?

Regards,

Comment by James Cook [ 2018 Jun 08 ]

Hi Aigars,

Please note the item name should be something like 'This is a test item ({#MACRO1})'

The brackets will allow you to see the inserted space in the name as it is created ie 'This is a test item ( )' where as I think it should read as 'This is a test item ()'.

Please note the item key should be something like 'test.item{#MACRO}'.

The item key does work correctly and produces 'test.item[]'

Regards

James

Comment by Alexander Vladishev [ 2018 Jun 11 ]

We can not reproduce this problem on mentioned version 3.4.8 and Zabbix 3.4.10. The item name was created without a space.

  • My item prototype:
  • Discovery data:
    {"data":[{"{#MACRO}":""}]}
  • Discovered item:

 What version of Zabbix are you using?

Comment by James Cook [ 2018 Jun 29 ]

We are running 3.4.8... Let me check again please and I will forward more information...

Generated at Sat Apr 05 08:16:24 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.