cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1193
Views
5
Helpful
17
Replies

CSS 11503 keepalive scripts

tomesmyth
Level 1
Level 1

Is it possible to configure a keepalive script to detect the text returned from a cold fusion web page - eg "server available". Not the header but actual content of the page.

17 Replies 17

Gilles Dufour
Cisco Employee
Cisco Employee

this is possible.

do a 'sho scrip ap-kal-httptag' and copy paste it into a file.

Then replace the line

--> socket waitfor ${SOCKET} "200 OK" 2000

With a socket waitfor ... "" 2000

Save the file and upload it via ftp to the css using a new name.

Regards,

gilles.

Thanks Gilles - I'll be trying that shortly

Giles,

I realize this is a year old. I did not try this recommendation yet, but used the following example from Cisco and this did not work:

===========

CS50#configure

CS50(config)# service Webserver-one

Create service << Webserver-one >, [y/n]:y

CS50(config-service[Webserver-one])# ip address 192.168.70.2

CS50(config-service[Webserver-one])# keepalive method head

CS50(config-service[Webserver-one])# keepalive port 80

CS50(config-service[Webserver-one])# keepalive type http

CS50(config-service[Webserver-one])# keepalive uri "/btauxdir/cfprobe.cfm

=================

But I then found this as well:

http://www.cisco.com/en/US/customer/products/hw/contnetw/ps792/products_tech_note09186a00801e1dfb.shtml

Doc ID: 47383

If the first solution in this e-mail failed, so should I pursue the second example here or the one you suggested to the original poster?

I am running Cold Fusion 5.0 on Windows 2000 with IIS 5.0 (I wish they had some training on scripting, etc for the CSS)

Thanks in advance

the example you showed is just a normal HTTP HEAD keepalive.

So, the CSS sends a HEAD request [not a GET, not a POST] and expect the response HTTP 200 OK.

It's far from what you need.

The only way to check if a text is contained in the response of the server is to use a script.

I don't think too much scripting knowledge is required here. All you have to do is follow my instruction. You just have to change one line.

Gilles.

Gilles,

Thanks. I tried that and no go. My example:

! Wait for a good status code

set EXIT_MSG "Waitfor: Failed"

socket waitfor ${SOCKET} "Webhosting: This CF server Okay!" 2000

This is verified to exist in the cfwhprobe.cfm file but it does not find the string and fails on line 37 in the script.

If you can assist it is appreciated.

capture a trace on the server and attach it to the forum.

Gilles.

Thanks. I am getting a 400 error.

The parameters are: "192.168.0.28 /whutil/cfwhprobe.cfm dev.login.course.com" and they are getting forward to the get statement. In the HTTP capture I am getting the Host field as the file name. I will look at this for another 5 minutes and send the capture.

Here is the 8K Ethereal Capture. Many Thanks.

the request sent is incorrect.

The parameters are below

set HostName "${ARGS}[1]" ===> ip address

set WebPage "${ARGS}[2]" ===> url

set HostTag "${ARGS}[3]" ===> hostname

the ip address you provided is correct.

But the url is currently /login/whutil/

and the hostname is cfwhprobe.cfm

So looks like you have a space between /login/whutil and cfwhprobe.cfm.

Remove the space and try again.

Gilles.

Gilles,

Thanks. I had the imput inverted. Thought it was much more. Thanks for the effort and help.

Spoke too fast. The captures on the server show progress, but the ap-kal-httptagcf script generates a script error on line 37. The inputs are correct: "IP /login/whutil/cfprobe.cfm dev.login.course.com" and I get a 200 and continuation on the web server.

Webhosting: This CF server Okay!

Webhosting: This CF server Okay!

The 1st line is what the server response contains.

The 2nd line is what the script expect.

As you can see, there is a difference.

[on the web we do not see the difference - I just noticed - but in text you can see there is 2 spaces between ':' and 'T' in the server string and only 1 space in the script].

I tested your script with a server returning the same line as what is in the script and it works.

Gilles.

you are correct. I cut and pasted from the generated web page, but in the code there is that space. Strange. I first thought it was the offset from AO, but it was just that space.

That was it. Thanks so much.

Gilles:

I know this is a two years old, but need some help with the issue regarding this post. I need to have a script keepalive to verify the content of a page. I tried what you mentioned here, but my service won't come up. My set up is this:

SERVICE

service serbancasawebback

type ssl-accel-backend

add ssl-proxy-list bhdssl

keepalive type script ap-kal-httptagban

protocol tcp

port 80

ip address 192.168.249.23

active

The script I used is as follows:

!no echo

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! Filename: ap-kal-httptagban

! Parameters: HostName WebPage HostTag

!

! Description:

! This script will connect to the remote host and do an HTTP

! GET method upon the web page that the user has asked for.

! This script also adds a host tag to the GET request.

!

! Failure Upon:

! 1. Not establishing a connection with the host.

! 2. Not receiving an HTTP status “200 OK”

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

if ${ARGS}[#] “NEQ” “3”

echo “Usage: ap-kal-httptagban \'192.168.249.23 /bancasa/start.swe?SWECmd=Logoff www2.bhd.com.do\'”

exit script 1

endbranch

! Defines:

set HostName “${ARGS}[1]”

set WebPage “${ARGS}[2]”

set HostTag “${ARGS}[3]”

! Connect to the remote Host

set EXIT_MSG “Connection Failure”

socket connect host ${HostName} port 80 tcp

! Send the GET request for the web page

set EXIT_MSG “Send: Failed”

socket send ${SOCKET} “GET ${WebPage} HTTP/1.0\nHost: ${HostTag}\n\n”

! Wait for a good status code

set EXIT_MSG “Waitfor: Failed”

socket waitfor ${SOCKET} “SWE Internal Error” 2000

no set EXIT_MSG

socket disconnect ${SOCKET}

exit script 0

Notice this is an SSL back-end service. The web page the user should request is:

https://www2.bhd.com.do/bancasa/start.swe?SWECmd=Logoff

If it returs the page with the error, then is down.

I'm not sure I have all arguments OK or in the correct format. Also,I'm a little confused regarding whta the Hostag should be.

Can you please verify what I have wrong ?

Thanks