[ZBXNEXT-4690] Web Scenario should have BOTH Positive & Negative content Match Created: 2018 Aug 15  Updated: 2018 Aug 20

Status: Reopened
Project: ZABBIX FEATURE REQUESTS
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Request Priority: Minor
Reporter: Brian Gilbert Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: usability, webmonitoring
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ALL



 Description   

Web Scenarios should have both a positive and negative Required String (content match).

  1. Word XXXX is required for an OK state.
  2. IF word ZZZZ is present the monitor goes to a PROBLEM state.


 Comments   
Comment by Alexey Pustovalov [ 2018 Aug 16 ]

It is already implemented. You can use "Global regular expression" with "Result is FALSE" condition: https://www.zabbix.com/documentation/3.4/manual/regular_expressions

Comment by Ingus Vilnis [ 2018 Aug 16 ]

Alexey, this would be great if global regular expressions would work in "Required string" field for web scenarios. But they don't :/

Brian, web.page.regexp agent item might be something to look into, but they also have limitations. 

https://www.zabbix.com/documentation/4.0/manual/config/items/itemtypes/zabbix_agent

Comment by Alexey Pustovalov [ 2018 Aug 16 ]

Yes, I agree, It is also nice idea!

Comment by Ingus Vilnis [ 2018 Aug 16 ]

ZBXNEXT-3806 is about exactly the same problem but a quick test with pcre negative lookahead did not return the desired result. The expression pattern is still evaluated as true thus the scenario step is successful. Some regex magic though might do the trick, I hope. 


^((?!ZZZZ).)*${noformat}
 

Comment by Glebs Ivanovskis [ 2018 Aug 19 ]

Pattern (?s)(?!.*ZZZZ)^ seems to do the trick.

Comment by Ingus Vilnis [ 2018 Aug 20 ]

Gleb, you are spot on as always!

However, if one must ask a top class C developer to solve this configuration request then it can't be considered as a feasible option for everyone. Which makes ZBXNEXT-3806 still valid.

Possible solutions would be additional field for negative match in the scenario step or added support for global regular expressions. 

Comment by Glebs Ivanovskis [ 2018 Aug 20 ]

Perhaps, we can ask martins-v to add this workaround as an example.

Comment by Brian Gilbert [ 2018 Aug 20 ]

This isn't working for me in Ver 3.0... Is this solution for Ver 3.4 ?  After the Regex changes?

Thanks

 

 

Comment by Glebs Ivanovskis [ 2018 Aug 20 ]

Yes, it uses PCRE features.

Generated at Sat Apr 20 08:17:46 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.