[ZBX-13365] Regular expression isn't evaluated correctly in trigger context Created: 2018 Jan 19  Updated: 2018 Jan 21  Resolved: 2018 Jan 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F), Server (S)
Affects Version/s: None
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Pascal Uhlmann Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: regexps, server, trigger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Uuntu 16.04, PHP 7.0


Issue Links:
Duplicate
duplicates ZBX-3924 frontend and daemons use different re... Closed

 Description   

We're using Zabbix version 3.0.11 and have a character item "healthString". To check its value there is the following trigger:

{test_host:healthString.regexp("^HEALTH_(OK|WARN.*|ERR ( ?\d+ (pgs repair|pgs inconsistent|scrub errors);?)+)$",#10)}=0

So if none of the latest 10 values matches the regular expression the trigger is fired. Unfortunately there are some values which should match the RegEx but nevertheless the trigger is fired.

Example value:
HEALTH_ERR 1 pgs inconsistent; 1 scrub errors

I verified the RegEx with different tools and also with the test function at the global regular expression page in the frontend. The result was always that the value matches the RegEx.

So I think there is an error with the RegEx evaluation.



 Comments   
Comment by Vladislavs Sokurenko [ 2018 Jan 19 ]

Note that 3.0 uses posix regular expressions so \d+ should be replaced by [[:digit:]]+
Closing as duplicate of ZBX-3924

Comment by Pascal Uhlmann [ 2018 Jan 21 ]

Thank you for this hint. After changing this it seems to work as expected.

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