This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

8. Web monitoring

Overview

With Zabbix you can check several availability aspects of web sites.

To perform web monitoring Zabbix server must be initially configured 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.

The following information is collected in any web scenario:

  • average download speed per second for all steps of whole scenario
  • failed step number
  • last error message

The following information is collected in any web scenario step:

  • download speed per second
  • response time
  • 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 always follows redirects. All cookies are preserved during the execution of a single scenario.

To use HTTP proxy, set the http_proxy environment variable for Zabbix server user. For example, //http_proxy=http:%%//%%proxy_ip:proxy_port//.

To perform HTTPS checks with the proxy, set the additional HTTPS_PROXY environment variable. For example, //HTTPS_PROXY=http:%%//%%proxy_ip:proxy_port//.

More details are available by running a shell command # man curl.

Configuring a scenario

The first step of creating a web scenario is creating a suitable application (unless you already have one). Web scenarios are linked to applications for grouping.

Then, to configure a web scenario:

  • Go to: Configuration → Web
  • 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.

General parameters:

Parameter Description
Application Select an application the scenario will belong to. The application must exist.
Name Unique scenario name.
Authentication Authentication options.
None - no authentication used.
Basic authentication - basic authentication is used.
NTLM authentication - NTLM (Windows NT LAN Manager) authentication is used.
Selecting an authentication method will provide two additional fields for entering a user name and password.
Update interval (in sec) How often the scenario will be executed, in seconds.
Agent Select a client agent.
Zabbix will pretend to be the selected browser. This is useful when a website returns different content for different browsers.
Variables List of variables (macros) for use in scenario steps (URL, Post variables).
They have the following format:
{macro1}=value1
{macro2}=value2
For example:
{username}=Alexei
{password}=kj3h5kJ34bd
The macros can then be referenced in the steps as {username} and {password}. Zabbix will automatically replace them with actual values.
Note: Variables are not URL-encoded.
Active The scenario is active if this box is checked, otherwise - disabled.

The Steps tab allows you to configure the web scenario steps.

Configuring steps

To add a web scenario step, click on Add in the Steps tab of a scenario form.

Step parameters:

Parameter Description
Name Unique step name.
URL URL to connect to and retrieve data. For example:
http://www.zabbix.com
https://www.google.com
GET variables can be passed in the URL parameter.
Post HTTP POST variables, if any.
For example:
id=2345&userid={user}
If {user} is defined as a macro of the web scenario, it will be replaced by its value when the step is executed.
The information will be sent as is, variables are not URL-encoded.
Timeout Zabbix will not spend more than the set amount of seconds on processing the URL. Actually this parameter defines maximum time for making connection to the URL and maximum time for performing an HTTP request. Therefore, Zabbix will not spend more than 2 x Timeout seconds on the step.
For example: 15
Required Required regular expressions pattern.
Unless retrieved content (HTML) matches required pattern the step will fail. If empty, no check is performed.
For example:
Homepage of Zabbix
Welcome.*admin
Note: Referencing regular expressions created in the Zabbix frontend is not supported in this field.
Status codes List of expected HTTP status codes. If Zabbix gets a code which is not in the list, the step will fail.
If empty, no check is performed.
For example: 200,201,210-299

Any changes in web scenario steps will only be saved when the whole scenario is saved.

See also a real-life example of how web monitoring steps can be configured.

Display

To view detailed data of defined web scenarios, go to Monitoring → Web or Latest data. Click on the scenario name to see more detailed statistics.

An overview of web monitoring scenarios can be viewed in Monitoring → Dashboard.