[ZBX-5644] Triggers which have expression with space(s) before and/or after an operator sign (<>#=) will be not shown in a graph legend Created: 2012 Oct 02  Updated: 2017 May 30  Resolved: 2012 Oct 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 1.8.16rc1, 2.0.3rc2
Fix Version/s: 2.0.4rc1, 2.1.0

Type: Incident report Priority: Major
Reporter: Oleksii Zagorskyi Assignee: Oleg Egorov (Inactive)
Resolution: Fixed Votes: 0
Labels: graphlegend, trigger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It turned out that if trigger expression has a space(s) before and/or after an operator sign (<>#=) - this trigger will be not shown in a graph legend.

Will be shown:

{host:itemkey.last(0)}

>444

Will not:

{host:itemkey.last(0)}

> 444

It's absolutely unclear what's going on, should be fixed.

Yes, many users are using spaces there when writing/editing expression manually, and it's not user's mistake, such expression is supported.



 Comments   
Comment by Oleg Egorov (Inactive) [ 2012 Oct 04 ]

RESOLVED in r30489

Comment by Toms (Inactive) [ 2012 Oct 05 ]

(1) There is no need to change trigger expression. I think expression in preg_match() function should be extended, so the all matching would be in the same place.
And FYI str_replace(' ', '', $txt) is much (simple benchmark showed more than 4x difference) faster than preg_replace('/\s+/', '', $txt);

oleg.egorov
In this situation:
preg_replace('/\s+/', '', $txt); - 0.000035 s.
str_replace(' ', '', $txt) - 0.000028 s.
Yes, I know, str_replace faster, but not so big difference I think.

RESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-5644 r30681

tomtom CLOSED

Comment by Toms (Inactive) [ 2012 Oct 08 ]

TESTED

Comment by richlv [ 2012 Oct 08 ]

(2) current changelog entry says "fixed problem with spaces in triggers expressions"
it is impossible for user to figure out what was that.
i'd suggest something like "fixed triggers with spaces in the expression missing from the graph legend" or similar

<richlv> was fixed, CLOSED

Comment by Oleg Egorov (Inactive) [ 2012 Oct 08 ]

Fixed in 2.0.4 r30686, 2.1.0 r30687

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