Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_selenium

Current Version
0.4
Last Release Date
2013-02-22
Owner
Hits
128863
Files:
FileDescription
check_selenium.tar.gzVersion 0.4 with check_selenium script
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
integrate your selenium test cases into nagios
The version 0.4 works with Selenium 2.x.


The current source code can be found on github:
https://github.com/czunker/check_selenium



Hi,

I've implemented 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:

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

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 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.

This plugin is written with Java and the Selenium test case is integrated with reflection. I'm sure you could also write this in Perl, Ruby or something different. I did it in Java because I had a bit of a mess with the needed Perl modules. Perhaps I will do a Perl version later.

(original post: http://devops-abyss.blogspot.com/2010/06/selenium-and-nagios.html)
Reviews (4)
byquestrad, November 4, 2015
Cannot download check_selenium.tar.gz
bytwh, February 29, 2012
Does not work with Selenium 2.x, could not get cases to run.
Owner's reply

A new Selenium 2.x compatible version can be found at:
https://github.com/czunker/check_selenium

It works like a charm for me.
But I have made some changes so you don't need to use a webbrowser (source code of CallSeleniumTest)

Thumbs up !! (Y)
bymarzlarz, July 14, 2010
1 of 1 people found this review helpful
While this plugin has great potential, the actual plugin itself ( check_selenium file ) is missing from the download page. Please update ASAP.
Owner's reply

Hi marzlarz,

I have updates the plugin, hope it will help you. If you encounter any more problems, feel free to send me an email.

Christian