Hi,
We have this configuration:
Red Hat Enterprise Linux Server release 5.3; 32 bit; VMWare Image of Nagiosxi; No special configurations.Using Mozilla Firefox3.6.8.
We are trying to use WebTransaction Plugin following the testcases from the manual How to monitor web sites with xi, but after creating a new valid account and replacing the values for USER and PASS; none test past succesfully. Below I pasted both files used: config.xml and testdata.xml.
http://library.nagios.com/library/produ ... -nagios-xi
******************************************************************************
orey_testdata.xml
<testcases repeat="1">
<testvar varname="USER">angel.quintero@cwpanama.com</testvar>
<testvar varname="PASS">password</testvar>
<case
id="1"
description1="Login page"
url="https://members.oreilly.com/account/login"
parseresponse='_authentication_token" type="hidden" value="|"|escape'
verifypositive="Sign in"
/>
<case
id="2"
description1="Sign in"
url="https://members.oreilly.com/account/login"
method="post"
postbody="email=${USER}&password=${PASS}&_authentication_token={PARSEDRESULT}"
verifypositive="https://members.oreilly.com/account/benefits"
parseresponse="found at |;"
/>
<case
id="3"
description1="Members page"
url="{PARSEDRESULT}"
verifypositive="view or edit your account information"
/>
<case
id="4"
description1="Book price"
url="http://oreilly.com/catalog/9781593271794/"
verifypositive="59.95"
/>
<case
id="5"
description1="Book added to cart"
url="https://epoch.oreilly.com/shop/cart.orm ... 71794.BOOK"
verifypositive="Nagios, 2Ed"
/>
<case
id="6"
description1="Book still in cart"
url="https://epoch.oreilly.com/shop/cart.orm"
verifypositive="Nagios, 2Ed"
verifynegative="Backorder"
/>
<case
id="7"
description1="Logout"
url="https://members.oreilly.com/account/logout"
verifypositive="http://oreilly.com/"
parseresponse="found at |;"
/>
<case
id="8"
description1="Main page"
url="{PARSEDRESULT}"
verifypositive="News & Commentary"
/>
</testcases>
**************************
more orey_config.xml
<testcasefile>orey_testdata.xml</testcasefile>
<useragent>User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firef
ox/3.6.8</useragent>
<timeout>20</timeout>
<globaltimeout>40</globaltimeout>
################################ OUTPUT ######################33
[nagios@nagioscwp webinject]$ ./webinject.pl -c orey_config.xml
Starting WebInject Engine...
-------------------------------------------------------
Test: orey_testdata.xml - 1
Login page
Verify : "Sign in"
[nagios@nagioscwp webinject]$ vi orey_testdata.xml
[nagios@nagioscwp webinject]$ ./webinject.pl -c orey_config.xml
Starting WebInject Engine...
-------------------------------------------------------
Test: orey_testdata.xml - 1
Login page
Verify : "Sign in"
Failed Positive Verification
Failed - No Response
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1161.
TEST CASE FAILED
Response Time = 196.038 sec
-------------------------------------------------------
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1148.
Test: orey_testdata.xml - 2
Sign in
Verify : "https://members.oreilly.com/account/benefits"
Failed Positive Verification
Failed - No Response
TEST CASE FAILED
Response Time = 200.539 sec
-------------------------------------------------------
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1148.
Test: orey_testdata.xml - 3
Members page
Verify : "view or edit your account information"
Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/site_perl/5.8.8/HTTP/Cookies.pm line
Failed Positive Verification
Failed - No Response
TEST CASE FAILED
Response Time = 0 sec
-------------------------------------------------------
Test: orey_testdata.xml - 4
Book price
Verify : "59.95"
Failed Positive Verification
Failed - No Response
TEST CASE FAILED
Response Time = 20.605 sec
-------------------------------------------------------
Test: orey_testdata.xml - 5
Book added to cart
monitor web sites with xi
-
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
Re: monitor web sites with xi
- Are you sure your xi server can access O'Reilly's web site?
- Do you have all of the necessary Perl libraries installed?
- That example is known not to work if you have an ampersand (&) in your password.
-
- Posts: 66
- Joined: Sat Feb 05, 2011 11:37 pm
Re: monitor web sites with xi
Ok Thanks tony.
So I will dismiss the internet test.
Basically I am using that example as template for monitoring our Intranet sites that requires user login checks. We have several services already monitored, but I tried adjusting the example for my needs:
Is necessary to install more modules in xi? Where is the list of modules to install in xi.
What I do not realize is the message: Use of uninitialized value in substitution (s///) at ./webinject.pl line 1161.
[root@nagioscwp webinject]# more unicorn_testdata.xml
<testcases repeat="1">
<testvar varname="USER">consulta</testvar>
<testvar varname="PASS">consulta23</testvar>
<case
id="1"
description1="Login page"
url="http://10.251.0.201/webclient/"
parseresponse='OLDVALUE_LOGINUSUARIO" type="hidden" value="|"|escape'
verifypositive="Usuario"
/>
<case
id="2"
description1="Sign in"
url="http://10.251.0.201/webclient/"
method="post"
postbody="LOGINUSUARIO=${USER}&LOGINPASSWORD=${PASS}&OLDVALUE_LOGINUSUARIO={PARSEDRESULT}"
verifypositive="VOD"
parseresponse="found at |;"
/>
<case
id="3"
description1="Members page"
url="{PARSEDRESULT}"
verifypositive="VOD"
/>
</testcases>
[root@nagioscwp webinject]# ./webinject.pl -c unicorn_config.xml
Starting WebInject Engine...
-------------------------------------------------------
Test: unicorn_testdata.xml - 1
Login page
Verify : "Usuario"
Failed Positive Verification
Passed HTTP Response Code Verification (not in error range)
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1161.
TEST CASE FAILED
Response Time = 0.051 sec
-------------------------------------------------------
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1148.
Test: unicorn_testdata.xml - 2
Sign in
Verify : "VOD"
Failed Positive Verification
Passed HTTP Response Code Verification (not in error range)
TEST CASE FAILED
Response Time = 0.004 sec
-------------------------------------------------------
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1148.
Test: unicorn_testdata.xml - 3
Members page
Verify : "VOD"
Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/site_perl/5.8.8/HTTP/Cookies.pm line 44.
Failed Positive Verification
Failed - No Response
TEST CASE FAILED
Response Time = 0 sec
-------------------------------------------------------
Start Time: Thu Mar 31 16:15:54 2011
So I will dismiss the internet test.
Basically I am using that example as template for monitoring our Intranet sites that requires user login checks. We have several services already monitored, but I tried adjusting the example for my needs:
Is necessary to install more modules in xi? Where is the list of modules to install in xi.
What I do not realize is the message: Use of uninitialized value in substitution (s///) at ./webinject.pl line 1161.
[root@nagioscwp webinject]# more unicorn_testdata.xml
<testcases repeat="1">
<testvar varname="USER">consulta</testvar>
<testvar varname="PASS">consulta23</testvar>
<case
id="1"
description1="Login page"
url="http://10.251.0.201/webclient/"
parseresponse='OLDVALUE_LOGINUSUARIO" type="hidden" value="|"|escape'
verifypositive="Usuario"
/>
<case
id="2"
description1="Sign in"
url="http://10.251.0.201/webclient/"
method="post"
postbody="LOGINUSUARIO=${USER}&LOGINPASSWORD=${PASS}&OLDVALUE_LOGINUSUARIO={PARSEDRESULT}"
verifypositive="VOD"
parseresponse="found at |;"
/>
<case
id="3"
description1="Members page"
url="{PARSEDRESULT}"
verifypositive="VOD"
/>
</testcases>
[root@nagioscwp webinject]# ./webinject.pl -c unicorn_config.xml
Starting WebInject Engine...
-------------------------------------------------------
Test: unicorn_testdata.xml - 1
Login page
Verify : "Usuario"
Failed Positive Verification
Passed HTTP Response Code Verification (not in error range)
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1161.
TEST CASE FAILED
Response Time = 0.051 sec
-------------------------------------------------------
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1148.
Test: unicorn_testdata.xml - 2
Sign in
Verify : "VOD"
Failed Positive Verification
Passed HTTP Response Code Verification (not in error range)
TEST CASE FAILED
Response Time = 0.004 sec
-------------------------------------------------------
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1148.
Test: unicorn_testdata.xml - 3
Members page
Verify : "VOD"
Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/site_perl/5.8.8/HTTP/Cookies.pm line 44.
Failed Positive Verification
Failed - No Response
TEST CASE FAILED
Response Time = 0 sec
-------------------------------------------------------
Start Time: Thu Mar 31 16:15:54 2011
-
- Posts: 66
- Joined: Sat Feb 05, 2011 11:37 pm
Re: monitor web sites with xi
Is necessary to install more modules in xi? Where is the list of modules to install in xi.
-
- Posts: 66
- Joined: Sat Feb 05, 2011 11:37 pm
Re: monitor web sites with xi
To be honest, I need HELP
Has anybody tested webinject with WRONG password?
it keeps me displaying TEST CASE PASSED and this is really annoying.....
-------------------------------------------------------
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1148.
Test: unicorn_testdata.xml - 2
Sign in
Verify Negative: "TV"
Passed Negative Verification
Passed HTTP Response Code Verification (not in error range)
TEST CASE PASSED
Response Time = 0.076 sec
*****************************************************************************EXAMPLE OF MY TESTCASE.
<testcases repeat="1">
<testvar varname="USER">consulta</testvar>
<testvar varname="PASS">BADPASSWORD</testvar>
<case
id="1"
description1="Login page"
url="http://10.251.0.201/webclient/"
verifypositive="DLO"
logresponse="yes"
/>
<case
id="2"
description1="Sign in"
method="get"
url="http://10.251.0.201/webclient/LogOut.php "
posttype="application/x-www-form-urlencoded"
postbody="OLDVALUE_LOGINUSUARIO=&LOGINUSUARIO=${USER}&LOGINPASSWORD=${PASS}={PARSEDRESULT}"
verifynegative="TV"
logresponse="yes"
/>
</testcases>
Has anybody tested webinject with WRONG password?
it keeps me displaying TEST CASE PASSED and this is really annoying.....



-------------------------------------------------------
Use of uninitialized value in substitution (s///) at ./webinject.pl line 1148.
Test: unicorn_testdata.xml - 2
Sign in
Verify Negative: "TV"
Passed Negative Verification
Passed HTTP Response Code Verification (not in error range)
TEST CASE PASSED
Response Time = 0.076 sec
*****************************************************************************EXAMPLE OF MY TESTCASE.
<testcases repeat="1">
<testvar varname="USER">consulta</testvar>
<testvar varname="PASS">BADPASSWORD</testvar>
<case
id="1"
description1="Login page"
url="http://10.251.0.201/webclient/"
verifypositive="DLO"
logresponse="yes"
/>
<case
id="2"
description1="Sign in"
method="get"
url="http://10.251.0.201/webclient/LogOut.php "
posttype="application/x-www-form-urlencoded"
postbody="OLDVALUE_LOGINUSUARIO=&LOGINUSUARIO=${USER}&LOGINPASSWORD=${PASS}={PARSEDRESULT}"
verifynegative="TV"
logresponse="yes"
/>
</testcases>
-
- Posts: 578
- Joined: Sat Nov 20, 2010 4:51 pm
Re: monitor web sites with xi
Hello,
I will check a few things here and see what we can do to help resolve this for you.
Thank you.
I will check a few things here and see what we can do to help resolve this for you.
Thank you.
-
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
Re: monitor web sites with xi
I'm really not sure. I'm afraid my experience with WebInject is limited to putting together those example testcases just for the documentation. It appears though that this sort of error is a result of failing to find the string for verification, and then of course failing when it tries to use that in a substitution later. A good place to start would be changing the output format from 'nagios' to I think 'standard', which will let you look through the raw HTTP responses and documents to manually look at the pages and headers coming back to see if they are what you think they should be. We can keep mulling this over, but there is also a WebInject user forum that will probably be able to give you a better answer if you'd be willing to give that a shot - http://www.webinject.org/cgi-bin/forums ... oard=Users.
-
- Posts: 349
- Joined: Tue Apr 13, 2010 2:15 pm
Re: monitor web sites with xi
What we did at our company is we started using Mechanize instead of WebInject. It is easier to understand and modify.tonyyarusso wrote:I'm really not sure. I'm afraid my experience with WebInject is limited to putting together those example testcases just for the documentation. It appears though that this sort of error is a result of failing to find the string for verification, and then of course failing when it tries to use that in a substitution later. A good place to start would be changing the output format from 'nagios' to I think 'standard', which will let you look through the raw HTTP responses and documents to manually look at the pages and headers coming back to see if they are what you think they should be. We can keep mulling this over, but there is also a WebInject user forum that will probably be able to give you a better answer if you'd be willing to give that a shot - http://www.webinject.org/cgi-bin/forums ... oard=Users.
http://search.cpan.org/~petdance/WWW-Me ... chanize.pm
We started trying to use WebInject and realized there was very little documentation to help us through issues.
-
- Posts: 578
- Joined: Sat Nov 20, 2010 4:51 pm
Re: monitor web sites with xi
Thank you for the tip nebias 
