Xymon Mailing List Archive search

Possible to have Hobbit retain and use cookies?

8 messages in this thread

list Martin Rogers · Wed, 12 Mar 2008 11:22:22 +0100 ·
We have an issue in using Hobbit to monitor a system of WebLogic and Oracle
application servers.  Hobbit is monitoring each of our 4 WebLogic servers on
a regular (30/60 second) basis.  By default, WebLogic creates a unique
HTTPSession when each request is served; this is keyed with a JSESSIONID
cookie which is sent back with the reply.  A browser, or our load generator
(Grinder) retains the cookie.

Hobbit seems to be discarding these cookies; the result is that each request
is generating a new Session.  This has little performance overhead, but
serves to confuse our WebLogic statistics; we can not tell how many 'real'
users there are logged on to our system, because they are masked by 700+
'hobbit' sessions.

It is possible to have Hobbit retain these cookies and send with subsequent
requests to the same URL?

Martin
list Charles Goyard · Wed, 12 Mar 2008 11:33:55 +0100 ·
Hi,
quoted from Martin Rogers

Martin Rogers wrote :
It is possible to have Hobbit retain these cookies and send with subsequent
requests to the same URL?
I had the exact same problem, hobbit created lots of sessions. Look at
the cookie feature in bbtest-net manpage. You will have to write the
cookie manually, but then it will be reused for all requests. For some
sites, providing a forged cookie works (so I use
"session=hobbitmonitor" as a cookie).

Regards,


-- 
Charles Goyard - user-a6cdca7046e2@xymon.invalid - (+33) 1 45 38 01 31
Orange Business Services - online multimedia  // ingénierie
list Martin Rogers · Wed, 12 Mar 2008 11:48:20 +0100 ·
Thanks for that rapid reply!

However we've looked at that option and if I understand it correctly that
would allow us to create a cookie in advance and read it from the file.  The
problem we have is that we have 4 weblogic servers, each of which will
generate a cookie automatically on the first request from Hobbit and return
it with the http response.  Writing the cookie in advance is not an option
as it would not be recognised as a valid session cookie by any of the
weblogic instances.

What we need Hobbit to do is to read the cookie on the first response and
use it on subsequent calls to that domain.. i.e. to emulate a browser.

Is it possible to do that without a code change? (our last resort!)

Regards,
Martin

On Wed, Mar 12, 2008 at 11:33 AM, Charles Goyard <
quoted from Charles Goyard
user-a6cdca7046e2@xymon.invalid> wrote:
Hi,

Martin Rogers wrote :
It is possible to have Hobbit retain these cookies and send with
subsequent
requests to the same URL?
I had the exact same problem, hobbit created lots of sessions. Look at
the cookie feature in bbtest-net manpage. You will have to write the
cookie manually, but then it will be reused for all requests. For some
sites, providing a forged cookie works (so I use
"session=hobbitmonitor" as a cookie).

Regards,


--
Charles Goyard - user-a6cdca7046e2@xymon.invalid - (+33) 1 45 38 01 31
Orange Business Services - online multimedia  // ingénierie

list Charles Goyard · Wed, 12 Mar 2008 12:02:33 +0100 ·
quoted from Martin Rogers
Martin Rogers wrote :
What we need Hobbit to do is to read the cookie on the first response and
use it on subsequent calls to that domain.. i.e. to emulate a browser.

Is it possible to do that without a code change? (our last resort!)
No, you cannot do that. But you can grab a valid cookie and put in
(manually, alas) in the cookie file. If your cookies expire, then it's
another problem.

Try injecting an invalid cookie, just for fun, it sometimes work. Some
CRMs will happily add the new cookie into their databases.
quoted from Martin Rogers


Regards,

-- 
Charles Goyard - user-a6cdca7046e2@xymon.invalid - (+33) 1 45 38 01 31
Orange Business Services - online multimedia  // ingénierie
list Buchan Milne · Wed, 12 Mar 2008 15:14:54 +0200 ·
quoted from Martin Rogers
On Wednesday 12 March 2008 12:48:20 Martin Rogers wrote:
Thanks for that rapid reply!

However we've looked at that option and if I understand it correctly that
would allow us to create a cookie in advance and read it from the file. 
The problem we have is that we have 4 weblogic servers, each of which will
generate a cookie automatically on the first request from Hobbit and return
it with the http response.  Writing the cookie in advance is not an option
as it would not be recognised as a valid session cookie by any of the
weblogic instances.

What we need Hobbit to do is to read the cookie on the first response and
use it on subsequent calls to that domain.. i.e. to emulate a browser.

Is it possible to do that without a code change? (our last resort!)
It is not possible with Hobbit only at present, but it is quite trivial to 
write a script that uses curl, that would work.

We test our webmail systems, which require a login (returning a cookie), and 
an inbox view (which requires the cookie) this way.

Regards,
Buchan
list Ralph Mitchell · Wed, 12 Mar 2008 09:13:18 -0500 ·
On Wed, Mar 12, 2008 at 8:14 AM, Buchan Milne <user-9b139aff4dec@xymon.invalid>
quoted from Buchan Milne
wrote:
On Wednesday 12 March 2008 12:48:20 Martin Rogers wrote:
Is it possible to do that without a code change? (our last resort!)
It is not possible with Hobbit only at present, but it is quite trivial to
write a script that uses curl, that would work.

We test our webmail systems, which require a login (returning a cookie),
and
an inbox view (which requires the cookie) this way.

I'd second that - I'm doing about 1500 tests spread over about 600 hosts,
all using curl with cookies, though I generally delete the cookie file at
the top of the script to avoid "open session" confusion.  There's no reason
not to keep on using the same cookie file, though.  Something like:

   curl -s -S -L -b cookiejar -c cookiejar -o file.html
http://server.domain.com

may be all you need.

Ralph Mitchell
list Martin Rogers · Wed, 12 Mar 2008 15:28:45 +0100 ·
Thanks for all the many responses and suggestions, I am impressed by the
community around this product!  I will probably have an opportunity to test
this out over the next couple of days; we do not have direct control over
the 'real' hobbit servers, so will have to duplicate in our test setup.

Martin

On Wed, Mar 12, 2008 at 3:13 PM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>
quoted from Ralph Mitchell
wrote:
On Wed, Mar 12, 2008 at 8:14 AM, Buchan Milne <user-9b139aff4dec@xymon.invalid>
wrote:
On Wednesday 12 March 2008 12:48:20 Martin Rogers wrote:
Is it possible to do that without a code change? (our last resort!)
It is not possible with Hobbit only at present, but it is quite trivial
to
write a script that uses curl, that would work.

We test our webmail systems, which require a login (returning a cookie),
and
an inbox view (which requires the cookie) this way.
I'd second that - I'm doing about 1500 tests spread over about 600 hosts,
all using curl with cookies, though I generally delete the cookie file at
the top of the script to avoid "open session" confusion.  There's no reason
not to keep on using the same cookie file, though.  Something like:

   curl -s -S -L -b cookiejar -c cookiejar -o file.html
http://server.domain.com

may be all you need.

Ralph Mitchell

list Henrik Størner · Thu, 13 Mar 2008 15:26:08 +0100 ·
quoted from Martin Rogers
On Wed, Mar 12, 2008 at 11:22:22AM +0100, Martin Rogers wrote:
We have an issue in using Hobbit to monitor a system of WebLogic and Oracle
application servers.  Hobbit is monitoring each of our 4 WebLogic servers on
a regular (30/60 second) basis.  By default, WebLogic creates a unique
HTTPSession when each request is served; this is keyed with a JSESSIONID
cookie which is sent back with the reply.  A browser, or our load generator
(Grinder) retains the cookie.

Hobbit seems to be discarding these cookies; the result is that each request
is generating a new Session.  This has little performance overhead, but
serves to confuse our WebLogic statistics; we can not tell how many 'real'
users there are logged on to our system, because they are masked by 700+
'hobbit' sessions.

It is possible to have Hobbit retain these cookies and send with subsequent
requests to the same URL?
I've given the cookie-handling code an overhaul, and added support for
session cookies as long as they appear in the HTTP headers - that is
true for most cases, but I have seen some webpages where cookies are set
through Javascript code. Cannot handle that...


Regards,
Henrik