9. Web monitoring
Overview
To perform web monitoring Zabbix server must be initially 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
- last error message
The following information is collected in any web scenario step:
- download speed per second
- response code
For more details, see 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 (using cURL option ). All cookies are preserved during the execution of a single scenario.
Configuring a web scenario
To configure a web scenario:
- Go to: Data collection → Hosts (or Templates)
- Click on Web in the row of the host/template
- Click on Create scenario to the right (or on the scenario name to edit an existing scenario)
- Enter parameters of the scenario in the form
The Scenario tab allows you to configure the general parameters of a web scenario.
Scenario parameters:
Note that when editing an existing scenario, two extra buttons are available in the form:
If HTTP proxy field is left empty, another way for using an HTTP proxy is to set proxy related environment variables.
For HTTP checks - set the http_proxy environment variable for the Zabbix server user. For example, http_proxy=http://proxy_ip:proxy_port
.
For HTTPS checks - set the HTTPS_PROXY environment variable. For example, HTTPS_PROXY=http://proxy_ip:proxy_port
. More details are available by running a shell command: # man curl.
The Steps tab allows you to configure the web scenario steps. To add a web scenario step, click on Add in the Steps block.
Secret must not be used in URLs as they will resolve to “******“.
Configuring steps
Step parameters:
Any changes in web scenario steps will only be saved when the whole scenario is saved.
See also a of how web monitoring steps can be configured.
Configuring tags
Tagging allows to filter web scenarios and web monitoring .
Configuring authentication
The Authentication tab allows you to configure scenario authentication options. A green dot next to the tab name indicates that some type of HTTP authentication is enabled.
Authentication parameters:
[1] Zabbix supports certificate and private key files in PEM format only. In case you have your certificate and private key data in PKCS #12 format file (usually with extension *.p12 or *.pfx) you may generate the PEM file from it using the following commands:
Zabbix server picks up changes in certificates without a restart.
If you have client certificate and private key in a single file just specify it in a “SSL certificate file” field and leave “SSL key file” field empty. The certificate and key must still be in PEM format. Combining certificate and key is easy:
Display
To view web scenarios configured for a host, go to Monitoring → Hosts, locate the host in the list and click on the Web hyperlink in the last column. Click on the scenario name to get detailed information.
An overview of web scenarios can also be displayed in Dashboards by the Web monitoring widget.
Recent results of the web scenario execution are available in the Monitoring → Latest data section.
Extended monitoring
If extended web monitoring is not required it can be stopped using the option.