Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

KEEPALIVE : CSSScript : Parse body of the get result

Hi,

I'm using a css 11000 with webns 5.

I need to build a service and add a keepalive on a specific URL.

As the query is always issued by a different engine, the hash value for the page is always different so i can't use get method with hash value match.

I want to do a get on a specific web page and parse the body to find a specific string. If this string is egal to "toto", as example, the css will consider that the service is alive.

If the string returned from the get is different from "toto", it will consider that the service is Down.

Perhaps, i can do this by using use-output option ...

Any help would be very appreciated

Thks

Alex

7 REPLIES
Cisco Employee

Re: KEEPALIVE : CSSScript : Parse body of the get result

you can for sure do this with a script.

Scripting on the CSS is explained at :

http://www.cisco.com/en/US/products/hw/contnetw/ps789/products_configuration_guide_chapter09186a00800d6b3f.html

I would suggest to do a 'socket connect' to the server and then a 'socket waitfor toto' if you want to receive toto.

Gilles.

New Member

Re: KEEPALIVE : CSSScript : Parse body of the get result

Just a last question :

Does the "socket wait for " command look in the entire page or only in header field ?

Here is an example of a page i want to parse

"

Error

TOTO

Will the "socket wait for" command be able to wait for TOTO at this point in the page ?

Thks for your quick answer on last question !!

Alex

Bronze

Re: KEEPALIVE : CSSScript : Parse body of the get result

Hello,

if an additional question regarding the waitfor command:

Does is realy wait until a specific string is in the TCP-Flow and then do the next action or has this string to appear at the beginning of the string and do I have to work with the offset command?

Thanks in advance for answering.

Kind Regards,

Joerg

Cisco Employee

Re: KEEPALIVE : CSSScript : Parse body of the get result

waitfor looks for a match anywhere in the data received.

So, no need of an offset.

Gilles

Bronze

Re: KEEPALIVE : CSSScript : Parse body of the get result

Hi Gilles,

thanks for your answer. I guess I've to check the tcp-session if there is some special character which is confusing the CSS and not getting the phrase I want to check for. If I don't find anything like that I guess that I've to open a Case or do you have any suggestion where to start searching? To be a bit more precise: I'm trying to monitor a whole login sequence. The entring of the username works fine the user name gets send but the request for the password fails.

Kind regards

Joerg

Cisco Employee

Re: KEEPALIVE : CSSScript : Parse body of the get result

waitfor is a tcp command.

So, it does not know if we are receiving http header or http body.

This means the string can be anywhere in the received data.

Gilles.

New Member

Re: KEEPALIVE : CSSScript : Parse body of the get result

Gilles,

Thanks for your answer : i'll test it asap.

I'm an ex-employee of cisco in France and i'm happy to see that people working at Cisco has very good knowledge of Cisco Product !! This remember me good times ...

Thks again

Alex

144
Views
0
Helpful
7
Replies
CreatePlease to create content