[ZBX-11211] Server tries to find functions in macro context when creating LLD calculated items from prototypes Created: 2016 Sep 15 Updated: 2017 May 30 Resolved: 2016 Nov 10 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 3.0.5rc1, 3.2.1rc1, 3.4.0alpha1 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Minor |
Reporter: | Glebs Ivanovskis (Inactive) | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 0 |
Labels: | calculateditems, lld, macrocontext | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Description |
Look how weird it is:
|
Comments |
Comment by Raymond Kuiper [ 2016 Sep 15 ] |
Sounds related to |
Comment by Sergejs Paskevics [ 2016 Sep 20 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-11211 |
Comment by Glebs Ivanovskis (Inactive) [ 2016 Sep 21 ] |
(1) zbx_user_macro_parse() is tricky, it skips first two characters, so before you call it you must assure that they are '{' and '$'. You can use calcitem_parse_expression() for inspiration. s.paskevics This case successfully tested in |
Comment by Glebs Ivanovskis (Inactive) [ 2016 Sep 21 ] |
(2) Speaking of calculate_parse_expression() and substitute_formula_macros()... They basically do the same job of parsing calculated item formula searching for functions and their parameters. For some reason they use different functions for that, parse_function() and zbx_function_parse() respectively. And where is code duplication, there are bugs too. Calculated item prototype:
Expected discovered calculated item:
Actual discovered calculated item:
Let's put everything in one piece of code. s.paskevics These cases successfully tested in |
Comment by Glebs Ivanovskis (Inactive) [ 2016 Sep 21 ] |
(3) I guess wiper will agree that for 3.2 and trunk we need a separate fix using zbx_token_find(). s.paskevics Sources has been changed it is overdue |
Comment by Glebs Ivanovskis (Inactive) [ 2016 Nov 09 ] |
I think this problem was completely solved by |
Comment by Sergejs Paskevics [ 2016 Nov 10 ] |
Closed by duplicate of |