|*Variables*|Variables that may be used in scenario steps (URL, post variables).<br>They have the following format:<br>**{macro1}**=value1<br>**{macro2}**=value2<br>**{macro3}**=regex:<regular expression><br>**{macro4}**=jsonpath:<jsonpath><br>**{macro5}**=xmlxpath:<xmlxpath><br>**{macro6}**={{macro}.function()} (see [macro functions](/manual/config/macros/macro_functions))<br>For example:<br>{username}=Alexei<br>{password}=kj3h5kJ34bd<br>{hostid}=regex:hostid is (\[0-9\]+)<br>{url}=jsonpath:$.host_url<br>{status}=xmlxpath://host/response/status<br>{newvar}={{myvar}.btoa()}<br>The macros can then be referenced in the steps as {username}, {password}, {hostid}, etc. Zabbix will automatically replace them with actual values. Note that variables with `regex:` need one step to get the value of the regular expression so the extracted value can only be applied to the step after.<br>If the value part starts with `regex:` then the part after it is treated as a regular expression that searches the web page and, if found, stores the match in the variable. At least one subgroup must be present so that the matched value can be extracted.<br>User macros and {HOST.\*} [macros](/manual/appendix/macros/supported_by_location) are supported.<br>Variables are automatically URL-encoded when used in query fields or form data for post variables, but must be URL-encoded manually when used in raw post or directly in URL.|
<?xml version='1.0' encoding='UTF-8'?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="zh-CN" datatype="plaintext" original="manual/web_monitoring.md">
<trans-unit id="734ebac5" xml:space="preserve">
<source># 9 Web monitoring</source>
<target># 9. Web 监控</target>
<trans-unit id="f37bc18c" xml:space="preserve">
With Zabbix you can check several availability aspects of web sites.\
To perform web monitoring Zabbix server must be
initially [configured](/manual/installation/install#from_the_sources)
with cURL (libcurl) support.
To activate web monitoring you need to define web scenarios. A web
scenario consists of one or several HTTP requests or "steps". The steps
are periodically executed by Zabbix server in a pre-defined order. If a
host is monitored by proxy, the steps are executed by the proxy.
Web scenarios are attached to hosts/templates in the same way as items,
triggers, etc. That means that web scenarios can also be created on a
template level and then applied to multiple hosts in one move.
The following information is collected in any web scenario:
- average download speed per second for all steps of whole scenario
- number of the step that failed
The following information is collected in any web scenario step:
- download speed per second
For more details, see [web monitoring
items](/manual/web_monitoring/items).
Data collected from executing web scenarios is kept in the database. The
data is automatically used for graphs, triggers and notifications.
Zabbix can also check if a retrieved HTML page contains a pre-defined
string. It can execute a simulated login and follow a path of simulated
mouse clicks on the page.
Zabbix web monitoring supports both HTTP and HTTPS. When running a web
scenario, Zabbix will optionally follow redirects (see option *Follow
redirects* below). Maximum number of redirects is hard-coded to 10
[CURLOPT\_MAXREDIRS](http://curl.haxx.se/libcurl/c/CURLOPT_MAXREDIRS.html)).
All cookies are preserved during the execution of a single scenario.</source>
要执行Web监控,Zabbix server的初始[configured](/manual/installation/install#from_the_sources)(配置)必须支持cURL (libcurl) 。