Page 1 of 2
webtranslation to monitor webpage
Posted: Mon Oct 23, 2017 8:41 am
by pkrk
HI,
I'm trying to check webtransaction with jboss , but i'm unable to monitoring it, once is only able to check the first page
the verifypositive just can read the first page , and not the second.
Code: Select all
<testcases repeat="1">
<testvar varname="LOGIN_URL">http://myserver/login.php</testvar>
<testvar varname="LOGIN1">bob</testvar>
<testvar varname="PASSWD1">sponge</testvar>
<testvar varname="SUCCESSFULL_TEST_TEXT">Welcome Bob</testvar>
<case
id="1"
description1="login test case"
description2="verify string login"
method="post"
url="${LOGIN_URL}"
postbody="login=${LOGIN1}&passwd=${PASSWD1}"
verifypositive="${SUCCESSFULL_TEST_TEXT}"
/>
</testcases>
Re: webtranslation to monitor webpage
Posted: Mon Oct 23, 2017 1:49 pm
by scottwilkerson
Can you give an example of the second case? I just see one case here which will just test one page.
Depending on your apps structure these can be complicated as you may need to pass variables from one case into the next case.
Re: webtranslation to monitor webpage
Posted: Mon Oct 23, 2017 2:18 pm
by pkrk
can't I do everything with one case?
I got this
verifypositive="${SUCCESSFULL_TEST_TEXT}"
that should verify is sentence is on page , but it doesn't , I'm trying to do it with jboss server
Re: webtranslation to monitor webpage
Posted: Mon Oct 23, 2017 3:35 pm
by cdienger
A second case/url would need to be created to test the second page.
Re: webtranslation to monitor webpage
Posted: Tue Oct 24, 2017 4:49 am
by pkrk
but the first case does not work , the user/passwod , if i change the password for fake one , the check is still valid
can you please let me know why?
Re: webtranslation to monitor webpage
Posted: Tue Oct 24, 2017 8:33 am
by mcapra
If you're just testing a simple page login with POST vars, you might be able to use check_http instead of writing complex web transactions. See this example where check_http is used to test login for a Confluence setup:
https://support.nagios.com/forum/viewto ... 71#p235371
Re: webtranslation to monitor webpage
Posted: Tue Oct 24, 2017 9:43 am
by cdienger
Does mcapra's suggestion help? I'd agree that this would be a better route to go if you can since it would be easier to configure.
I would need more information to troubleshoot the web tranasction issue - the actual xml file containing the cases and a tcpdump would be helpful. Tcpdumps can be gathered with:
Code: Select all
yum -y install tcpdump
tcpdump -s 0 -i any host ip.of.web.server -w output.pcap
Let it run long enough to run the check and use CTRL+C to stop it. Both the xml and pcap file can contain sensitive information so avoid posting it directly on the forum and PM it to me if needed.
Re: webtranslation to monitor webpage
Posted: Tue Oct 24, 2017 10:37 am
by pkrk
I need to used webtrasanction , once i need to login with user and password , and further on to do other action , such as check deployments etc ...
but just the simple check user/password does not work
Re: webtranslation to monitor webpage
Posted: Tue Oct 24, 2017 2:20 pm
by dwhitfield
We would need more information to troubleshoot the web transaction issue - the actual xml file containing the cases and a tcpdump would be helpful. Tcpdumps can be gathered with:
Code: Select all
yum -y install tcpdump
tcpdump -s 0 -i any host ip.of.web.server -w output.pcap
Let it run long enough to run the check and use CTRL+C to stop it. Both the xml and pcap file can contain sensitive information so avoid posting it directly on the forum and PM it to me if needed. Alternatively, if you're a customer, you can email it to
[email protected]
Re: webtranslation to monitor webpage
Posted: Mon Nov 06, 2017 10:38 am
by pkrk
Hi,
For example the code below doesn't work , i try with nagiosxi to login and password and does not work , but if i try just with case 1 it works
Code: Select all
<testcases repeat="1">
<case
id="1"
url="http://nagios01/nagiosxi/login.php"
verifyresponsecode="200"
verifypositive="con"
errormessage="Can not display the login page."
/>
<case
id="2"
method="post"
url="http://nagios01/nagiosxi/login.php"
postbody="usernameBox=nagiosadmin&passwordBox=nagiosadmin"
verifyresponsecode="302"
verifynegative="Authorization failed"
errormessage="Login failed."
/>
</testcases>
~