Please help --- script for http and port

Unanswered Question
Apr 10th, 2007


I am trying to make a script to do health check against a web page on port other than 80.

When I run my script:

script play ap-kal-http-port " 30200 /ebss-aml-web/HealthCheck"

I got:

Error in script playback line:38

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

Here is my script:

!no echo


! Filename: ap-kal-http-port

! Parameters: HostName HealthWebPage


! Description:

! This script will keepalive a WWW server on port other than 80


! Failure Upon:

! 1. Not establishing a connection with the host.

! 2. Not being able to receive the cookie


if ${ARGS}[#] "NEQ" "3"

echo "Usage: ap-kal-ebssdb \'Hostname PortNumber HealthWebPage\'"

exit script 1


! Defines:

set HostName "${ARGS}[1]"

set PortNumber "${ARGS}[2]"

set HealthWebPage "${ARGS}[3]"

! Connect to the remote host (use default timeout)

set EXIT_MSG "Connection Failed"

socket connect host ${HostName} port ${PortNumber} tcp 2000

! send our request to the host

set EXIT_MSG "Send: Failure"

socket send ${SOCKET} "GET ${HealthWebPage} HTTP/1.0\n\n"

! Wait for the health message to come in

set EXIT_MSG "Waitfor: Failure"

socket waitfor ${SOCKET} " 200 " 2000

! Done

no set EXIT_MSG

socket disconnect ${SOCKET}

exit script 0

Appreciate your help.


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Gilles Dufour Tue, 04/10/2007 - 22:19


did you sniff the traffic to verify that the server actually respond with a HTTP 200 OK ?



This Discussion