No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a Nagios check for Selenium test cases.
With this check it is possible to put your recorded test cases from your Selenium IDE into Nagios to use them for monitoring.

In my opinion this has the following advantages:

    * You can transfer your test cases to monitoring without making any changes.
    * You can run the test cases with multiple browsers. 
      This means, you use the JavaScript and rendering engine of the browser not any other HTML/HTTP library.
    * You are more flexible, when monitoring more complex scenarios.

To get this working, you need the following components:
(the jars needed for the check to run are already included in the source tree/zip file)

    * Nagios (I assume you have this already running)
    * check_selenium (
    * Selenium IDE (
    * Selenium Server (
    * JUnit library (

There are two possible scenarios how you could put this to work:

    * Install the Selinium RC server on your Nagios host.
    * Install the Selinum RC server on a different host.

I will only explain how you can set up the Selenium RC server on your Nagios host. When you want to install it on a different 
server you currently have to use nrpe/nsca to get it going. This is the only difference, the rest stays the same. You can contact 
the Selenium RC server directly on another server, but this is not yet implemented.

First record your test case with the Selenium IDE. When you've not done this before, take a look at the Selenium IDE documentation 
( After recording it, export it to a Java file (File -> Export Test Case As ... -> Java (JUnit) - Selenium RC). 
Compile this Java file with javac or your favorite IDE. For compilation you already need the JUnit library and the file selenium-server.jar:

    javac -cp ./junit.jar:./selenium-server.jar [your test case file]

On your Nagios host, put check_selenium into your libexec path, add the files CallSeleniumTest.class, junit.jar and selenium-server.jar somewhere. 
Adjust the classpath in the check_selenium file. As the Selenium IDE puts the Java classes automatically in the package com.tests.examples, 
create a directory com/tests/examples on your filesystem and add it to the classpath. Put the compiled Java file into this directory.

Add the definition to your nagios configuration and test it. When your nagios server is a headless linux system, you can also run Selenium RC 
headless with Xvfb. Take a look at this post (, how to set it up.

Hope this all gives you new ways how to monitor your web applications or make the already established way a bit easier.

The plugin also returns performance data for the test cases, but be aware the returned time also contains the startup time for the browser.

Update 2011/07:
Some people asked for a more detailed explanation on integrating check_selenium into Nagios. Here are two possible solutions how to integrate it. The first one is with NRPE. The check runs on a different host. With the second possibility, the check runs on your Nagios host.
define command {
  command_name  nrpe_check_selenium
  command_line  $USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -p 5666 -c check_selenium -a "$ARG1$"

define command {
  command_name  local_check_selenium
  command_line  $USER1$/check_selenium "$ARG1$"
After that, you can define your service and asign it to a host:
define service {
  service_description   nrpe_selenium_Google
  use   service-check-05min
  check_command  nrpe_check_selenium!com.example.tests.GoogleTestCase

define service {
  service_description  selenium_Google
  use  service-check-05min
  check_command    local_check_selenium!com.example.tests.GoogleTestCase

When executing the check via NRPE, add a line like this to your nrpe.cfg file on your remote host:

command[check_selenium]=/usr/local/nagios/libexec/ --class "$ARG1$"
Hope this will help some people to get faster results.