Page 1 of 1
check_selenium plugin
Posted: Fri Dec 20, 2013 6:56 am
by stuartevansuk
Hi Guys,
Has anyone got any experience with this plugin? When running this against a selenium test case it doesn't output Nagios friendly information? I get the full selenium test script data.
I'm following this doc;
http://exchange.nagios.org/directory/Do ... XI/details
Using Nagios with Selenium scripts
Firstly we must add the Selenium check to our plugin directory “usually /usr/local/nagios/libexec”:
The check may be found here:
wget
http://assets.nagios.com/downloads/nagi ... k_selenium
Once the plugin has been added, from the Nagios terminal make sure you are in the libexec directory and run the following:
chmod 755 check_selenium
./check_selenium –script=/usr/local/nagios/libexec/simpletest
What the check_selenium script is doing is running
the simpletest script and returning the data all at
once at the end in a friendly way readable by Nagios.
Re: check_selenium plugin
Posted: Fri Dec 20, 2013 11:09 am
by slansing
Can you show us what output you are getting? Also a copy of your test script? You can scrub data you do not wish to share but please give us an indication of what you are changing and where.
Re: check_selenium plugin
Posted: Sat Jul 19, 2014 3:13 pm
by mkeil77
hi,
i know this is actually an old post but i'm facing the same issue.
please find attached output of the perl script which where already some data seems to be missing in the end.
i also attached the sample script.
thanks in advance for any help
script
Code: Select all
use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
my $sel = Test::WWW::Selenium->new( host => "xx.xx.xx.xx",
port => 4444,
browser => "*firefox",
browser_url => "https://freightnet.geodiswilson.com/Util/login.aspx?ReturnUrl=%2f" );
$sel->open_ok("/Util/login.aspx?ReturnUrl=%2f");
$sel->type_ok("id=ctl00_FullRegion_LoginControl_UserName", "abcdef");
$sel->type_ok("id=ctl00_FullRegion_LoginControl_Password", "123456");
$sel->click_ok("id=ctl00_FullRegion_LoginControl_Login");
$sel->wait_for_page_to_load_ok("30000");
$sel->click_ok("link=Home");
$sel->wait_for_page_to_load_ok("30000");
$sel->click_ok("id=ctl00_ctl00_buttonLogout");
$sel->wait_for_page_to_load_ok("30000");
output of the perl script
Code: Select all
ok 1 - open, /Util/login.aspx?ReturnUrl=%2f
ok 2 - type, id=ctl00_FullRegion_LoginControl_UserName, abcdefg
ok 3 - type, id=ctl00_FullRegion_LoginControl_Password, 1234567
ok 4 - click, id=ctl00_FullRegion_LoginControl_Login
ok 5 - wait_for_page_to_load, 30000
ok 6 - click, link=Home
ok 7 - wait_for_page_to_load, 30000
ok 8 - click, id=ctl00_ctl00_buttonLogout
ok 9 - wait_for_page_to_load, 30000
1..9
output of the check_selenium script
Code: Select all
UNKNOWN: ok 1 - open, /Util/login.aspx?ReturnUrl=%2f
ok 2 - type, id=ctl00_FullRegion_LoginControl_UserName, waemake
ok 3 - type, id=ctl00_FullRegion_LoginControl_Password, Alcatraz92
ok 4 - click, id=ctl00_FullRegion_LoginControl_Login
ok 5 - wait_for_page_to_load, 30000
ok 6 - click, link=Home
ok 7 - wait_for_page_to_load, 30000
ok 8 - click, id=ctl00_ctl00_buttonLogout
ok 9 - wait_for_page_to_load, 30000
1..9
Re: check_selenium plugin
Posted: Mon Jul 21, 2014 4:25 pm
by sreinhardt
That is definitely not nagios formatted output. The original posters plugin looks like it may work, but if you are using the one in your first code comment, that absolutely will not work for nagios. I would highly suggest either trying the OP's plugin or finding another one for selenium on exchange, there should be more than a few last I checked. Once you find another one, give it a try, if you have any issues post a link and the things you have tried with output.
Re: check_selenium plugin
Posted: Tue Jul 22, 2014 1:40 am
by mkeil77
i just looked into it again this morning and i figured out that the 'clean script' was not executing correctly.
After fixing that everything is now working.
Matt
Re: check_selenium plugin
Posted: Tue Jul 22, 2014 10:21 am
by slansing
Ahh, yep that is required to clean it up before nagios executes it, thanks for letting us know!