[ZBX-10681] Possible loss of parameter trailing whitespace when creating calculated items with low level discovery Created: 2016 Apr 19  Updated: 2017 May 30  Resolved: 2016 May 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.0.16
Fix Version/s: 2.0.18rc1, 2.2.13rc1, 3.0.3rc1, 3.2.0alpha1

Type: Incident report Priority: Major
Reporter: Andris Zeila Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: calculateditems
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If calculated item formula contains low level discovery macro in unquoted parameter, then the trailing whitespace for this parameter will be lost if the macro value has characters that forces parameter quoting in the discovered item.

For example:
Calculated item prototype has formula str(<key>, abc{#M} ). If the macro {#M} has value (), then the discovered item will have formula str(<key>, "abc()" ), which is not correct - the trailing whitespace is included in parameter and must be quoted too: str(<key>, "abc() ").



 Comments   
Comment by Andris Zeila [ 2016 Apr 19 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-10681

Comment by Aleksandrs Saveljevs [ 2016 Apr 20 ]

(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.

wiper RESOLVED in r59588

asaveljevs CLOSED

wiper This issue was fixed only in 2.0 branch. Because of changes in item key parsing a new issue was created to fix this bug in 2.2 and later, see ZBX-10723.

Comment by Andris Zeila [ 2016 Apr 28 ]

Released in:

  • pre-2.0.18rc1 r59782
  • pre-2.2.13rc1 r59790
  • pre-3.0.3rc1 r59791
  • pre-3.1.0 r59792
Generated at Thu Apr 25 00:59:45 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.