Setting up Selenium Synthetics to run with LogicMonitor involves installing the Selenium GRID where a LogicMonitor Collector can access it, and then updating the Collector with information about the Selenium GRID. This enables you to add a Selenium Synthetics Webcheck in your LogicMonitor portal for ingesting Synthetics data to LogicMonitor.
To set up Selenium Synthetics with LogicMonitor, you need the following:
- Selenium GRID 4
See Selenium’s Selenium Grid 4 documentation for more information.
- LogicMonitor Collector 34.100 or later
Note: The Collector must be installed where it has access to the Selenium GRID. See Installing Collectors.
Selenium GRID Installation
The Selenium GRID is a smart proxy server that can execute Selenium Synthetics checks. It can operate as a standalone Hub or as a Hub with smaller Nodes to allow tests to run in parallel. During installation, you can specify the browser or environment you want to use for certain tests, and specify how large you would like each Node to be. You can install the Selenium GRID using the following methods:
- Method 1: Install the Selenium GRID in a container
Note: This method allows you to install Selenium GRID using pre-configured images, or you can install Selenium GRID manually in a container and configure additional settings during the installation.
- Method 2: Install the Selenium GRID locally
Method 1: Installing the Selenium GRID in a Container
You can install the Selenium GRID in Docker or Kubernetes.
You can install the Selenium GRID in a Docker container using the following pre-configured images available from the provider:
For more information about installing the Selenium GRID in Kubernetes, see Selenium on Kubernetes from Kubernetes.
Alternatively, you can manually create a container and install Selenium GRID by creating a Hub with Nodes. The following example procedure demonstrates how to install Selenium GRID in a Docker container:
- Create a Docker network using the following command:
$ docker network create grid
- Use the following command to start a Selenium Hub:
$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.0.0
- Use the following command to start a Chrome Node using the environment variables:
$ docker run -d --net grid --name selenium-chrome -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-chrome:4.0.0
- Use the following command to start an Edge Node:
$ docker run -d --net grid --name selenium-edge -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium/node-edge:93.0-edgedriver-93.0-grid-4.0.0
Optional Docker Configurations
You can use the following configuration options when setting up Selenium Grid as a Standalone through Docker. You can configure these options as environment variables when starting the Docker container. Some configuration options, like
SE_NODE_SESSION_TIMEOUT, are given default values by the Docker container, and must be specifically overridden. Other configuration options can be added by altering the
SE_OPTS environment variable, which is a catch-all for configuration options that do not have default values.
|Session Request Timeout||This setting is configured when starting the Standalone Docker container. The session request timeout determines how many seconds a request waits in the session queue for an available node before timing out. Default is 300 seconds. Retries are done every five seconds. If the session request timeout is set to zero, requests wait in the queue indefinitely.|
It is possible to override those values through environment variables in the Hub and the SessionQueue (
This option can be set by passing –session-request-timeout as an additional option into the
|Max Sessions||This setting is configured when starting the Standalone Docker container. The max sessions setting determines the amount of available browser sessions that can handle a request. Changing this setting to more than the number of available processors may lead to sessions failing because of insufficient resources. In both the Chrome and Edge Standalone Docker containers, the max sessions setting is given a default value of 1. This setting can be set by overriding the |
|Node Session Timeout||After session slot has been taken by a test request, this setting controls how long the session is allowed to remain idle without any activity before the slot is freed. In both the Chrome and Edge Standalone Docker containers, the node session timeout setting is given a default value of 300 seconds. This setting can be set by overriding the |
The Selenium Side Runner has a dependency on the NodeJS; therefore, you must install Node 8 or 10 before installing a side runner.
If you make configuration changes to your Docker container, you must restart the container by identifying the container ID and executing a start command similar to the following:
#find the container id’s (not running) $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 75bca4385216 selenium/node-edge:93.0-edgedriver-93.0-grid-4.0.0-rc-1-prerelease-20210823 "/opt/bin/entry_poin…" 10 days ago Exited (255) 6 minutes ago 5900/tcp selenium-edge 77615a7ada1c selenium/node-chrome:4.0 "/opt/bin/entry_poin…" 10 days ago Exited (255) 6 minutes ago 5900/tcp selenium-chrome b838fe090610 selenium/hub:4.0 "/opt/bin/entry_poin…" 10 days ago Exited (255) 6 minutes ago 0.0.0.0:4442-4444->4442-4444/tcp, :::4442-4444->4442-4444/tcp selenium-hub #start the containers $ docker start 75bca4385216 77615a7ada1c b838fe090610 75bca4385216 77615a7ada1c b838fe090610 #now they’re running $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 75bca4385216 selenium/node-edge:93.0-edgedriver-93.0-grid-4.0.0-rc-1-prerelease-20210823 "/opt/bin/entry_poin…" 10 days ago Up 14 seconds 5900/tcp selenium-edge 77615a7ada1c selenium/node-chrome:4.0 "/opt/bin/entry_poin…" 10 days ago Up 13 seconds 5900/tcp selenium-chrome b838fe090610 selenium/hub:4.0 "/opt/bin/entry_poin…" 10 days ago Up 9 seconds 0.0.0.0:4442-4444->4442-4444/tcp, :::4442-4444->4442-4444/tcp selenium-hub
Method 2: Installing the Selenium GRID Locally
You can install the Selenium GRID (both Hub and Node included) as a standalone installation, or you can install the Hub and Nodes as a separate installation.
To install the Selenium GRID locally, you need the following:
- Selenium Server Standalone package jar
This includes the Selenium Hub, WebDriver, and RC needed to run the GRID.
- Java installed and added to the environment variables
- The browser installed that you want to test
- The appropriate drivers for the test browser downloaded and added to PATH
To install the Selenium GRID as a standalone, execute the following command to start the Selenium GRID:
java -jar selenium-server-<version>.jar standalone
Note: This command starts a standalone Selenium GRID using port 4444 by default. You can use an alternate port using the following command:
java -jar selenium-server.jar standalone host
When Selenium starts, it provides the URI for accessing the GRID. Navigate to the URI in the browser to view the Selenium console and the available hubs and nodes.
To install the Selenium server Hub, execute the following command:
java -jar selenium-server-<version>.jar hub
To start a Node associated with the Hub, execute the following command:
java -jar selenium-server-<version>.jar node --hub http://<hub-ip>:<port number>
Note: The hup-ip is the IP of the Selenium server Hub (usually localhost) and the port number is 4444 by default, unless specified otherwise during setup.
Updating the LogicMonitor Collector for Synthetics
The LogicMonitor Collector uses the
agent.conf configuration file and its assigned properties in setup. For a Collector to run Selenium Synthetics checks, the URL where the Collector is able to access the grid must be provided as a property before it is selectable in the LogicMonitor portal to assign a Selenium Synthetics Webcheck.
- Navigate to the Collector that has access to the Selenium GRID in Settings > Collectors, and select the Manage icon.
- From the Support dropdown menu, select “Collector Configuration”.
- Toggle the Edit agent.conf manually switch, and add the Selenium GRID URL to the
- Click Save and Restart.
The Collector restarts with the Selenium Synthetics Webcheck assigned to it.
Downloading the SIDE file
You can download the SIDE file used for your Synthetics Web Check.
- In LogicMonitor, navigate to Resources > select Synthetics resource.
- Select (Manage Resource Options) .
- Select Download SIDE file.