12-13-2010 06:33 AM
I have a CSS reporting script problems when I am using build-in script ap-kal-httptag, here my exact command and CSS failure response:
script play ap-kal-httptag "192.168.8.22 content/corp/main/en/group.html?noCache=true Sika"
brgsikalb01#
Error in script playback line:37
>>>socket waitfor ${SOCKET} "200 OK" 2000
brgsikalb01#
Script Playback cancelled.
Waitfor: Failed
The CSS build in script ap-kal-httptag failes during execution!
Failure is on line 37 which contains this command [ socket waitfor ${SOCKET} "200 OK" 2000 ]
CSS commits this failure string [
Error in script playback line:37
>>> socket waitfor ${SOCKET} "200 OK" 2000
]
Was there a command syntax change and Cisco forgot to reprogram the build-in scripts?
Here I copy the full script taken from CSS in question directly:
show script ap-kal-httptag
!no echo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Filename: ap-kal-httptag
! 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-httptag \'Hostname WebPage HostTag\'"
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 2000
! 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} "200 OK" 2000
no set EXIT_MSG
socket disconnect ${SOCKET}
exit script 0
I can not see any broken limitation on this command [ socket waitfor ${SOCKET} "200 OK" 2000 ]
Thanks for advise and / or correction
12-14-2010 02:33 AM
The failure just means the server did not respond with an HTTP 200 OK response.
For example, it could be a 302 Redirect or a 404 Unauthorised.
Check with a sniffer trace what is the response from the server.
Gilles.
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