[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: advanced HTTP query (cookies)

From: Ben Hartshorne
Subject: Re: advanced HTTP query (cookies)
Date: Fri, 26 Aug 2005 10:02:35 -0700
User-agent: Mutt/1.5.9i

On Fri, Aug 26, 2005 at 06:25:23PM +0200, Martin Pala wrote:
> Hi,
> i think you can use monit's SEND/EXPECT statements - example usage:
> --8<--
>  if failed host port 4040
>     send "Open, Sesame!\r\n"
>     expect "Please enter the cave\r\n"
>     send "Shut, Sesame!\r\n"
>     expect "See you later [A-Za-z ]+\r\n"
>  then restart
> --8<--
> It should be possible to write the send/expect sequence as http requests 
> with the cookie in the http header where needed ...


I was looking at that syntax, but the string I need to test for
'success' is buried further than 256 Bytes into the page.  I saw that
the SEND/EXPECT statements are good for protocol negotiation, but
getting the cookie to the web page is only the first part.  I actually
do use the SEND/EXPECT syntax for the back-end testing, because I need
to verify an XML schema.  

Also, if I understand the SEND/EXPECT schema, even though it uses regexp
to match the incoming strings, I would still havet to code in pretty
much the entire page up to the string I'm looking for, wouldn't I?

So my understanding is that the SEND/EXPECT syntax won't be able to
solve my problem.  



> Martin
> Ben Hartshorne wrote:
> >Hi all,
> >
> >I am interested in monitoring a web site in a little bit more depth.
> >By testing certain funcitonality through the front end, I can infer that
> >a service suporting the front end is running successfully.  I'm also
> >monitoring the back end directly, but I like to get it 'as the customer
> >sees it.'  
> >
> >In order to complete this HTTP query, I must include cookies in my
> >request.  The following wget line will successfully get as deep as I
> >would like to go:
> >
> >wget --cookies=off --header "Cookie: 
> >sh3=id%3D1970583178430e5e1b0a3b72.85050652%3Bcv%3D2%3Brv%3D3d3b01f6%3B; 
> >sh2=db%3De8744%3Bcso%3D430e5fcd%3Bslu%3D430e5e1b%3Bref%3Dsh%3B" 
> >\&mj=1
> >
> >I must then parse the returned page for "Jobs 1 - 1" to verify success.
> >
> >I don't see any documentation on how to specify a more complex query
> >using the 'url' option, which would be best.  
> >
> >I was suprised not to see an external program as a test for monit - i.e.
> >run an external program (such as the wget line above, or a shell script
> >that runs wget and then parses the output on its own), which then
> >returns success or failure.  
> >
> >Do any of you have any suggestions on how to implement the test I need?
> >
> >Thanks,
> >
> >-ben
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >--
> >To unsubscribe:
> >
> --
> To unsubscribe:

Ben Hartshorne
email: address@hidden

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]