[ZBX-11411] Missing check macro value in formula for being numeric Created: 2016 Nov 01  Updated: 2018 May 31  Resolved: 2016 Nov 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: None
Fix Version/s: 2.2.16rc1, 3.0.6rc1, 3.2.2rc1, 3.4.0alpha1

Type: Incident report Priority: Minor
Reporter: Sergejs Paskevics Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Causes
causes ZBX-13236 ZBX-11411 prevents ability to use ite... Closed

 Description   

In formula (calculated item) should be added additional check - if macro substitutes as constant, it value should be numeric.



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2016 Nov 02 ]

I guess it was specifically about LLD macros and calculated item prototype formulas or trigger prototype expressions.

Comment by Viktors Tjarve [ 2016 Nov 16 ]

Now checking if values in LLD macros are numeric in calculated item formulas. LLD macros in trigger prototypes already are being checked for numeric values.

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

Comment by Andris Zeila [ 2016 Nov 16 ]

Successfully tested

Comment by Viktors Tjarve [ 2016 Nov 16 ]

Released in:

  • 2.2.16rc1 r63816
  • 3.0.6rc1 r63818
  • 3.2.2rc1 r63821
  • 3.3.0 r63822
Comment by Beth Neary [ 2017 Feb 09 ]

We have recently updated to zabbix 2.2.16 which has broken some of our low level discovery calculated items, I am assuming due to this fix.

The formula for the item is just a macro {#CLIENT_TOTAL_FUNCTION}. This gets populated via the following low level discovery json string:

{"data":[{
"{#CLIENT_TOTAL_NAME}":"Total quota",
"{#CLIENT_TOTAL_KEY}":"quota",
"{#CLIENT_TOTAL_FUNCTION}":"last(as.quota)"}
]}

I am now getting this error:

Cannot update item: macro "{#CLIENT_TOTAL_FUNCTION}" value is not numeric

This was all working fine before the update, but now the macro is not being parsed correctly. It should be recognised as a function, but it is being interpreted as a constant.

Comment by Glebs Ivanovskis (Inactive) [ 2017 Feb 10 ]

Dear beth@cs, I feel sorry that we have not introduced such validation earlier. We are pretty confident that we did a right thing and this change will not be reverted. I am sure that you generate LLD JSON with a script, making this script create item via API is a cleaner non-hackish and therefore supported way to make such custom calculated items.

Comment by Glebs Ivanovskis [ 2018 May 31 ]

Hm, for some reason current trunk (r81394) allows LLD macro to be empty string if it is used as constant in calculated item formula.

Generated at Thu Apr 25 16:25:37 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.