09-27-2005 06:42 AM
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.
09-27-2005 11:06 PM
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 ... "
Save the file and upload it via ftp to the css using a new name.
Regards,
gilles.
09-28-2005 11:28 PM
Thanks Gilles - I'll be trying that shortly
10-15-2006 05:25 PM
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:
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
10-15-2006 11:47 PM
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.
10-17-2006 05:33 AM
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.
10-17-2006 06:26 AM
capture a trace on the server and attach it to the forum.
Gilles.
10-17-2006 08:18 AM
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.
10-17-2006 08:28 AM
10-17-2006 10:34 PM
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.
10-18-2006 04:24 AM
Gilles,
Thanks. I had the imput inverted. Thought it was much more. Thanks for the effort and help.
10-18-2006 04:45 AM
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.
10-18-2006 05:25 AM
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.
10-18-2006 06:40 AM
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.
06-17-2009 03:49 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide