See www.zabbix.com for the official Zabbix site.

Docs/specs/ZBXNEXT-1597

From Zabbix.org
Jump to: navigation, search

Content retrieval based on regular expressions for Web monitoring

ZBXNEXT-1597

Status: v1.3

Owner: Alexei

Summary

It is often required to use retrieved HTML content for consecutive steps. The functionality could be used for session IDs, for example.

Specification

Web monitoring steps will accept new parameter, list of variables to extract. Each variable is represented by variable name and a regular expression. The variable could be used in consecutive steps same way as scenario-level variables.

Allowed syntax:

 {authID}=fixed_value
 {authID}=regex:<regex>

In case of 'regex:' prefix Zabbix will try to match this regular expression with returned HTML content (without headers) and keep the value in variable {authID}. Maximum value length will be limited to 255 characters and will be cut if it contains more characters.

Web step will fail if regex pattern contains no capture groups or there is no match.

Step-level variables will overwrite scenario-level ones. 'regex:' style variable defined on scenario level will be used for each step.

Posix extended regular expressions with multiline matching will be used. First sub-expression will be captured and returned.

Server and proxy

  • httptest.macros should be renamed to httptest.variables everywhere in C code

Front-end

Web step scenario form will contain new field 'Variable' located after 'Post', same size as 'Post'.

  • No default value
  • Same validation rules as for scenario-level Variables

Web scenario form should be updated to use httptest.variables instead of httptest.macros.

API changes

  • httptest.create and httptest.update methods will be extended to support new text field 'variables' in scenario step properties.
  • changes related to renaming of httptest.macros to httptest.variables

Database changes

Database patch must be created:

  • Existing field 'httptest.macros' will be renamed to 'httptest.variables'
  • New field for table 'httpstep'
 FIELD           |variables         |t_shorttext         |""     |NOT NULL       |ZBX_SYNC,ZBX_PROXY

Documentation

  • What's new
  • Zabbix Manual
  • Database structure

ChangeLog

  • N/A