
# Website by Browser

## Overview

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- ChromeDriver 124.0.6367.207, selenium-server-4.0.0-alpha-6

## Configuration

> Zabbix should be configured according to the instructions in the [Templates out of the box](https://www.zabbix.com/documentation/7.0/manual/config/templates_out_of_the_box) section.

## Setup

Install WebDriver.
For more information, please refer to the [Selenium WebDriver](https://www.selenium.dev/documentation/webdriver/) page.
Run selenium-server.
Add in configuration file WebDriver interface HTTP[S] URL. For example http://localhost:4444

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$WEBSITE.BROWSER}|
Browser to be used for data collection.
|`chrome`|
|{$WEBSITE.DOMAIN}|
The domain name.
|`www.example.com`|
|{$WEBSITE.PATH}|
The path to resource.
||
|{$WEBSITE.SCHEME}|
The request scheme, which may be either HTTP or HTTPS.
|`https`|
|{$WEBSITE.SCREEN.WIDTH}|
Screen size width in pixels, used for screenshot.
|`1920`|
|{$WEBSITE.SCREEN.HEIGHT}|
Screen size height in pixels, used for screenshot.
|`1080`|
|{$WEBSITE.RESOURCE.LOAD.MAX.WARN}|
The maximum browser response time expressed in seconds for a trigger expression.
|`5`|
|{$WEBSITE.NAVIGATION.LOAD.MAX.WARN}|
The maximum browser response time expressed in seconds for a trigger expression.
|`5`|
|{$WEBSITE.GET.DATA.INTERVAL}|
Update interval for get raw data item.
|`0s;m/15`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Website {$WEBSITE.DOMAIN} Get data|
Returns the JSON with performance counters of the requested website.
|Browser|website.get.data
**Preprocessing**

- 
Check for not supported value: `any error`

⛔️Custom on fail: Discard value

|
|Get metrics check|
Check that the performance counters of the requested website data has been received correctly.
|Dependent item|website.metrics.check
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to

- 
Discard unchanged with heartbeat: `3h`

|
|Website {$WEBSITE.DOMAIN} Screenshot|
Website {$WEBSITE.DOMAIN} screenshot.
|Dependent item|website.screenshot
**Preprocessing**

- 
JSON Path: `$.screenshot`

⛔️Custom on fail: Discard value

|
|Website {$WEBSITE.DOMAIN} Navigation load event time|
Measuring of load finished time (loadEventEnd).
|Dependent item|website.navigation.load_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.load_finished`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation response time|
Measuring of time spend on the response (responseEnd - responseStart).
|Dependent item|website.navigation.response_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.response_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation request time|
Measuring of time spend on the request (responseStart - requestStart).
|Dependent item|website.navigation.request_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.request_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation resource fetch time|
Measuring of time spent to fetch the resource (without redirects) (responseEnd - fetchStart).
|Dependent item|website.navigation.resource_fetch_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.resource_fetch_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation service worker processing time|
Measuring of sum of time spend on browser's service worker processing (fetchStart - workerStart).
|Dependent item|website.navigation.service_worker_processing_time
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation domContentLoaded time|
Measuring of time spent on DOM content loading (domContentLoadedEventEnd - domContentLoadedEventStart).
|Dependent item|website.navigation.dom_content_loaded_time
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation DNS lookup time|
Measuring of time spent on DNS lookup (domainLookupEnd - domainLookupStart).
|Dependent item|website.navigation.dns_lookup_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.dns_lookup_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation TCP handshake time|
Measuring of time spent on TCP handshake (connectEnd - connectStart).
|Dependent item|website.navigation.tcp_handshake_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.tcp_handshake_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation TLS negotiation time|
Measuring of time spent on TLS negotiation (requestStart - secureConnectionStart).
|Dependent item|website.navigation.tls_negotiation_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.tls_negotiation_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Navigation encodedBody size|
Measuring of encoded size (encodedBodySize).
|Dependent item|website.navigation.encoded_size
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.encoded_size`

⛔️Custom on fail: Discard value

|
|Website {$WEBSITE.DOMAIN} Navigation decodedBody size|
Measuring of total size (decodedBodySize).
|Dependent item|website.navigation.total_size
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.total_size`

⛔️Custom on fail: Discard value

|
|Website {$WEBSITE.DOMAIN} Navigation transfer size|
Measuring of transferred size (transferSize).
|Dependent item|website.navigation.transferred_size
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.navigation.transferred_size`

⛔️Custom on fail: Discard value

|
|Website {$WEBSITE.DOMAIN} Resource load event time|
Measuring of load finished time (loadEventEnd).
|Dependent item|website.resource.load_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.load_finished`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource response time|
Measuring of time spend on the response (responseEnd - responseStart).
|Dependent item|website.resource.response_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.response_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource request time|
Measuring of time spend on the request (responseStart - requestStart).
|Dependent item|website.resource.request_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.request_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource fetch time|
Measuring of time spent to fetch the resource (without redirects) (responseEnd - fetchStart).
|Dependent item|website.resource.fetch_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.resource_fetch_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource service worker processing time|
Measuring of sum of time spend on browser's service worker processing (fetchStart - workerStart).
|Dependent item|website.resource.service_worker_processing_time
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource domContentLoaded time|
Measuring of time spent on DOM content loading (domContentLoadedEventEnd - domContentLoadedEventStart).
|Dependent item|website.resource.dom_content_loaded_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.dom_content_loading_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource DNS lookup time|
Measuring of time spent on DNS lookup (domainLookupEnd - domainLookupStart).
|Dependent item|website.resource.dns_lookup_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.dns_lookup_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource TCP handshake time|
Measuring of time spent on TCP handshake (connectEnd - connectStart).
|Dependent item|website.resource.tcp_handshake_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.tcp_handshake_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource TLS negotiation time|
Measuring of time spent on TLS negotiation (requestStart - secureConnectionStart).
|Dependent item|website.resource.tls_negotiation_time
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.tls_negotiation_time`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Website {$WEBSITE.DOMAIN} Resource encodedBody size|
Measuring of encoded size (encodedBodySize).
|Dependent item|website.resource.encoded_size
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.encoded_size`

⛔️Custom on fail: Discard value

|
|Website {$WEBSITE.DOMAIN} Resource decodedBody size|
Measuring of total size (decodedBodySize).
|Dependent item|website.resource.total_size
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.total_size`

⛔️Custom on fail: Discard value

|
|Website {$WEBSITE.DOMAIN} Resource transfer size|
Measuring of transferred size (transferSize).
|Dependent item|website.resource.transferred_size
**Preprocessing**

- 
JSON Path: `$.performance_data.summary.resource.transferred_size`

⛔️Custom on fail: Discard value

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Website by Browser: Failed to get metrics data|
Failed to get JSON with performance counters of the requested website '{$WEBSITE.DOMAIN}'.
|`length(last(/Website by Browser/website.metrics.check))>0`|High||
|Website by Browser: Website navigation load event time is too slow||`last(/Website by Browser/website.navigation.load_time)>{$WEBSITE.NAVIGATION.LOAD.MAX.WARN}`|Warning|**Depends on**:

- Website by Browser: Failed to get metrics data
|
|Website by Browser: Website resource load event time is too slow||`last(/Website by Browser/website.resource.load_time)>{$WEBSITE.RESOURCE.LOAD.MAX.WARN}`|Warning|**Depends on**:

- Website by Browser: Failed to get metrics data
|

## Feedback

Please report any issues with the template at [`https://support.zabbix.com`](https://support.zabbix.com)

You can also provide feedback, discuss the template, or ask for help at [`ZABBIX forums`](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback)

