Part 80: Monitor your new Selenium

What's up, home? part 80 cover image: Monitor your Selenium

A quick tip to possibly give you new ideas.

As Zabbix got the new fantastic Selenium-based synthetic web tests, you will now have a new component to monitor. How do you monitori Selenium? With Zabbix, of course! If you are inpatient, feel free to download my very bare bones example template.

But... how to monitor Selenium?

That part is easy. Selenium server exposes you a status URL at <your-selenium-URL>/status, for example http://my.selenium.server:4444/status -- the data from there is coming back as JSON. Either grab it all via LLD, low-level discovery rules, or just cherry pick few values to follow. I cherry picked few values, as the status contains so many items I would not ever need. No, my Selenium is not going to test stuff through Microsoft Edge browser, for example. Below is a short snippet from status page output.

{
  "value": {
    "ready": true,
    "message": "Selenium Grid ready.",
    "nodes": [
      {
        "id": "e284925e-c341-41fc-8380-581ead4987b6",
        "uri": "http:\u002f\u002f0.0.0.0:4444",
        "maxSessions": 10,
        "osInfo": {
          "arch": "aarch64",
          "name": "Mac OS X",
          "version": "14.5"
        },
        "heartbeatPeriod": 60000,
        "availability": "UP",
        "version": "4.21.0 (revision 79ed462ef4)",
        "slots": [

First confirm that your Selenium gives you back that status page. Done? Done. Next, move on and create a new Zabbix template.

Create a new Zabbix template

Go to Data collection -> Templates -> Create template, give it a name, assign it to any template groups you want.

Creating a template

Next, click on Macros tab, and enter there {$SELENIUM_URL} = your.selenium.server.address/status

Add Selenium URL

Done. Now save your template and start adding items.

Add new items to template

First, add a new HTTP agent type item for fetching the master data.

Add new master item

Next, just add any items you would like to pick from the long JSON output: as I'm only interested if Selenium is ready and what is the message it is returning, here is an example of how I grab the items. First the one which checks for if Selenium is ready (true/false)

Selenium ready

... and get that with item pre-processing by using JSONPath and Boolean to decimal, so you get numeric values for graphs and so on.

Item pre-processing

The end result

After this, you are already monitoring your new Selenium to make sure that it is feeling well. 

Latest data

Now go and add your Selenium to monitoring, too! Add some triggers and visualize it for yourself by using some of the new fancy widgets we have in Zabbix 7.0! 

 

 

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Buy me a coffee

Like these posts? Support the project and Buy me a coffee