Xymon Mailing List Archive search

post test with httpstatus

3 messages in this thread

list Francois Herbert · Fri, 24 Feb 2012 09:07:08 +1300 ·
I've got a post test running which tests a login page, if the page is successful, the user gets a 302 status code in the header and no content (the user gets redirected)
If the page is not successful the user is returned to the login page without the 302 status code.

I've tried setting up a number of tests:

1. post=login;https://loginpage.my.domain/login.php;action=login&ID=username&Password=password
2. nopost=login;https://loginpage.my.domain/login.php;action=login&ID=username&Password=password;login

The text 'login' is present on the login page (which the user gets sent back to if the login is unsuccessful).

If the page and login works fine then the following happens in xymon:
Test 1: Green
Test 2: Red  (xymon output is https:/loginpage.my.domain/login.php - Testing URL yields: No output received from server)

If the page and login is failing then the following happens in xymon:
Test 1: Green
Test 2: Red (xymon output is https:/loginpage.my.domain/login.php - Testing URL yields: {login page displayed})

So the failure test works, but since no html is sent when the login is successful (just a 302 redirect), the success page fails as well!
I'm not sure how I can get this login page monitored.

I've looked at the httpstatus check, but this doesn't appear to be able to be used by posting data to a form.

Anybody have any ideas?

Thanks
Francois Herbert
list Jeremy Laidman · Fri, 24 Feb 2012 13:16:12 +1100 ·
On Fri, Feb 24, 2012 at 7:07 AM, Herbert, Francois
quoted from Francois Herbert
<user-796032f63edb@xymon.invalid> wrote:
I've got a post test running which tests a login page, if the page is successful, the user gets a 302 status code in the header and no content (the user gets redirected)
If the page is not successful the user is returned to the login page without the 302 status code.
Maybe use "nopost" and set the expected data to be ".".  That way, if
any content is returned, then the login has failed.  Something like
this:

nopost=login;https://loginpage.my.domain/login.php;action=login&ID=username&Password=password;.

J
list Francois Herbert · Fri, 24 Feb 2012 15:22:52 +1300 ·
Thanks for the suggestion, It doesn't work though, xymon reports: Content match failed: No output received from server

So it seems that if there is no content, then xymon can't test for that????
quoted from Jeremy Laidman

On 24/02/2012, at 3:16 PM, Jeremy Laidman wrote:
On Fri, Feb 24, 2012 at 7:07 AM, Herbert, Francois
<user-796032f63edb@xymon.invalid> wrote:
I've got a post test running which tests a login page, if the page is successful, the user gets a 302 status code in the header and no content (the user gets redirected)
If the page is not successful the user is returned to the login page without the 302 status code.
Maybe use "nopost" and set the expected data to be ".".  That way, if
any content is returned, then the login has failed.  Something like
this:

nopost=login;https://loginpage.my.domain/login.php;action=login&ID=username&Password=password;.

J