04-10-2007 06:56 PM
Hi,
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 "10.60.27.27 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
endbranch
! 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.
Richard
04-10-2007 10:19 PM
Richard
did you sniff the traffic to verify that the server actually respond with a HTTP 200 OK ?
Gilles.
04-11-2007 05:29 AM
will do
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