In creating Web URL monitors that require login, whether on our internal apps, or in the Zabbix Documentation Real life scenario under Web Monitoring - We always with this error: Step "Login in" [2 of 5] failed: error in step variables "{sid}=regex:name="csrf-token" content="([0-9a-z]{16})"": cannot extract the value of "{sid}" from response. Is the regex supposed to be used identically to the Real life scenario documentation for Zabbix Front End? Or, will we need to alter that in some way? If we are to use the regex command as stated in the document, what might we have configured incorrectly to always receive this error? Any feedback will be appreciated. Thank you.
Ad Widget
Collapse
Cannot extract value of "{sid}" from response
Collapse
X
-
1) Are you sure that your connection is working (can you read it using curl and the same parameters) ? If yes...
2) Using sed in the response, the result is what you expect?
3) I don't use web scenarios a log, but i think the double quotes in your example are ambiguous ... -
The documentation examples enclose the regex in quotes, I have since found out you shouldn't do this. At this point I went the route of parsing the value using a php script and then calling that script to get the form_key. I have a simple line: regex:[0-9a-zA-Z]{16}
You can see the file retrieved here (this is for POC and will be locked down once I get it working): http://54.158.136.254/get-form-key.php
To parse a value such as this: http://sanitized/get-form-key.php
I verified the regex will get the value but zabbix is still showing:Error: error in step variables "{formkey}=regex:[0-9a-zA-Z]{16}": cannot extract the value of "{formkey}" from response It's really quite puzzling Last edited by skione13; 11-03-2020, 19:38.Comment
-
Thanks Tim! I put the regex inside the parens and now I am getting an OK but I have tried various times using that, not sure what I was doing wrong. Also the examples in the web scenario section of the docs don't show this.Comment
-
The examples I see show using parens, both in https://www.zabbix.com/documentation...web_monitoring and in https://www.zabbix.com/documentation...toring/example .
The web_monitoring section on "Variables" says specifically:
At least one subgroup must be present so that the matched value can be extracted.Comment
Comment