!no echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Parameters: Site1 Port WebPage1 Site2 Port WebPage2 [...] ! ! Description: ! Cisco CSS script to get a web page and check the result ! This script will connect a list of sites/port/webpage pairs. The ! user must simply supply the site, and then the webpage and ! we'll attempt to do an HTTP HEAD on that page. ! ! Failure Upon: ! 1. Not establishing a connection with the host. ! 2. Not receiving a status code 200 on the HEAD request on any ! one site. If one fails, the script fails. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Make sure the user has a qualified number of arguments if ${ARGS}[#] "LT" "2" echo "Usage: ap-kal-httplist \'WebSite1 WebPage1 WebSite2 WebPage2 ...'" exit script 1 endbranch while ${ARGS}[#] "GT" "0" set Site "${ARGS}[1]" var-shift ARGS if ${ARGS}[#] "==" "0" set EXIT_MSG "Parameter mismatch: hostname present but webpage was not" exit script 1 endbranch set Port "${ARGS}[1]" var-shift ARGS set Page "${ARGS}[1]" var-shift ARGS no set EXIT_MSG function HeadUrl call "${Site} ${Port} ${Page}" endbranch exit script 0 function HeadUrl begin ! Connect to the remote Host set EXIT_MSG "Connect: Failed to connect to ${ARGS}[1]" socket connect host ${ARGS}[1] port ${ARGS}[2] tcp 2000 ! Send the head request set EXIT_MSG "Send: Failed to send to ${ARGS}[1]" socket send ${SOCKET} "HEAD ${ARGS}[3] HTTP/1.0\n\n" ! Wait for the status code 200 to be given to us set EXIT_MSG "Waitfor: Failed to wait for '200' on ${ARGS}[1]" socket waitfor ${SOCKET} " 200 " 2000 no set EXIT_MSG socket disconnect ${SOCKET} function HeadUrl end