Install check_centreon_waa and selenium


This howto describes the installation of Centreon Web Application Analytics plugin. This plugin monitor your web application availability running by a scenario. To write a scenario, the plugin uses Selenium IDE to be installed in Firefox browser.

How it work ?

  • Nagios run check_centreon_waa plugin with the parameter a scenario
  • check_centreon_waa connect to Selenium server.
  • Selenium server use a X server (Xvfb), start Firefox and run the scenario


Add EPEL repository :

# rpm -ivh

Last versions used is check_centreon_waa-1.0.3.tar.gz and selenium-server-standalone-2.31.0.jar. Perhaps, there are new updates.

Run commands :

# yum install -y firefox xorg-x11-server-Xvfb xorg-x11-xauth java-1.6.0-openjdk perl-Test-WWW-Selenium perl-XML-XPath
# cd /usr/src
# wget
# wget

Disable EPEL Repository, edit /etc/yum.repos.d/epel.repo file

name=Extra Packages for Enterprise Linux 5 - $basearch

Install Files

# cd /usr/src
# tar xzf check_centreon_waa-1.0.3.tar.gz
# cd check_centreon_waa-1.0.3
# cp extras/centos/init-xvfb /etc/init.d/xvfb
# chmod +x /etc/init.d/xvfb
# chkconfig --add xvfb
# cp extras/centos/init-selenium /etc/init.d/selenium
# chmod +x /etc/init.d/selenium
# chkconfig --add selenium
# cp extras/centos/default-xvfb /etc/default/xvfb
# cp extras/centos/default-selenium /etc/default/selenium
# cp check_centreon_waa /usr/lib/nagios/plugins/
# chmod +x /usr/lib/nagios/plugins/check_centreon_waa
# mkdir -p /var/lib/centreon_waa


Post install


Modify /etc/default/xvfb file :


Create directory :

# mkdir -p /usr/local/labkey/

Start xvfb :

# /etc/init.d/xvfb start


# mkdir /opt/selenium
# mv /usr/src/selenium-server-standalone-2.31.0.jar /opt/selenium
# cd /opt/selenium
# ln -s  selenium-server-standalone-2.31.0.jar selenium-server-standalone.jar

Modify /etc/default/selenium file :

# Configuration for /etc/init.d/selenium

# If run selenium at startup default: NO

# Path to selenium JAR

# Selenium port default: 4444

# Selenium user default: selenium

# Selenium log dir default: /var/log/selenium

# The firefox profile directory for use in selenium. Run "firefox -ProfileManager" to create a new profile and custom it.
# Example SELENIUM_FFPROFILE=/var/run/selenium/.mozilla/firefox/XXXXXX.selenium

# X display port default: :99

Add user :

# useradd -s /bin/false -d /var/run/selenium -m selenium
# mkdir -p /var/log/selenium
# chown selenium:selenium /var/log/selenium

Patch  /etc/init.d/selenium (line 32) :

su -s /bin/bash - ${SELENIUM_USER} -c "DISPLAY=${X_DISPLAY} nohup ${JAVA_BIN} -jar ${SELENIUM_LIB}/selenium-server-standalone.jar -port ${SELENIUM_PORT} ${PROFILE_FIREFOX} >${SELENIUM_LOGDIR}/selenium.log 2>${SELENIUM_LOGDIR}/selenium_err.log & echo $! >${PIDFILE}"

Start selenium :

# /etc/init.d/selenium start


Setting FireFox

Connect by ssh to FAN server and enabled X11 forwarding

On your computer, run

$ ssh -X root@FANSERVER

Run firefox :

# firefox -ProfileManager
  • Click on “Create Profile” and Next

  • Enter a profile name : selenium
  • Choose folder : /opt/selenium

  • Click on Finish
  • Start Firefox


Install Selenium IDE

Go to

Download the latest version (1.10.0 released) and allow the installation in firefox

Restart firefox


Run Selenium IDE :

Create a test (scenario web)

An example, our test have several steps :

  • Connect to
  • Verify text or word is present
  • Go an another page “Documentation”

Run the Selenium IDE and in Base URL :

Start the recording :


In firefox, go to

Select “Home” word

Right clic and select “verifyTextPresent Home”


In the IDE window, you can see the changes


In the banner, clic on “Documentation”


Stop the recording :

Play the test :


Selenium play the test :

Check the result :


Save the test in the directory “/var/lib/centreon_waa” : webtest-FAN.html


Nagios config files

Create a new command check :

define command{
    command_name    check_centreon_waa
    command_line    $USER1$/check_centreon_waa -c $ARG2$ -w $ARG3$ -d /var/lib/centreon_waa/ -t $ARG1$ -r localhost:4444

Create a new service :

define service{
    host_name                CheckScenarioWeb
    service_description      ScenarioWeb_FAN
    use                      generic-service
    check_command            check_centreon_waa!webtest-FAN!30!20



No comments yet.

six + = 7

No trackbacks yet.