[ZBX-10723] Possible loss of leading whitespace in key parameters when creating items with low level discovery Created: 2016 Apr 28  Updated: 2017 May 30  Resolved: 2016 Jun 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.12, 3.0.2, 3.2.0alpha1
Fix Version/s: 2.2.14rc1, 3.0.4rc1, 3.2.0alpha1

Type: Incident report Priority: Minor
Reporter: Andris Zeila Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: lld, macros
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File key_parameters.png     PNG File parameter_unquoted_string.png    

 Description   

Taken from ZBX-10681.1
Suppose we have the following item prototype:

item[{#VALUE}]

If the value of the LLD macro is " value ", the following item is created:

item[ value ]

However, this is wrong, because the leading space will be trimmed when parsing key parameters. To keep the spaces this parameters should have been quoted: item[" value "]



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2016 May 11 ]

(1) Item key format diagrams should be updated to reflect that leading spaces are skipped in the process of item parameter parsing.

Probably like so:
Key parameters

Parameter - unquoted string

glebs.ivanovskis Since there is actually no way to incorporate spaces in existing schemes properly it was decided to keep old (imprecise but simple) schemes.
WON'T FIX

Comment by Glebs Ivanovskis (Inactive) [ 2016 May 23 ]

Fix for version 2.2 is available in development branch svn://svn.zabbix.com/branches/dev/ZBX-10723 revision 60256.

Opted for a simple and effective solution from ZBX-10681. User macros and LLD macros will be treated equally. Added check for backslash at the end of unquoted parameter that needs to be quoted because of ",", "]" or leading space.

Comment by Alexander Vladishev [ 2016 May 24 ]

Successfully tested.

Removed check for backslash at the end of item key parameters in r60278.

Comment by Glebs Ivanovskis (Inactive) [ 2016 Jun 01 ]

Fixed in pre-2.2.14rc1 r60465, pre-3.0.4rc1 r60466, pre-3.1.0 (trunk) r60467.

Generated at Fri Mar 29 07:34:31 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.