Cisco 11500 CSS http keepalive check for web content?

Discussion in 'Cisco' started by RT, Nov 23, 2004.

  1. RT

    RT Guest

    Howdy all,


    I want to use a script on a cisco css(V7.3) to check for the web
    content returned from a http get. From a browser, let say I browse to
    http://myweb/test.dll then I would get a page with a text line saying
    "Alive".

    However when I play the css script from the ccs command line (script
    play myscript "myweb test.dll Alive"), I get the following error:

    CSS# no set CONTINUE_ON_ERROR
    CSS# set EXIT_MSG "Send: Failed. Could not send to
    ${WebSite}:${WebPort}"
    CSS# socket send ${SOCKET} "GET ${WebPage} HTTP/1.1\n\nHost:
    ${WebSite}:${WebPort}\n"
    CSS# set EXIT_MSG "Waitfor: Failed. Did not find [${WebString}]"
    CSS# set CONTINUE_ON_ERROR "1"
    CSS# socket waitfor ${SOCKET} "${WebString}" case-sensitive
    %% String not found
    CSS# if ${STATUS} "NEQ" "0"
    exit script 1

    Waitfor: Failed. Did not find [Alive]

    Anyone run into this before and could lend a helping hand? Below is
    the cisco article and script that I use for this keepalive.

    Thx

    http://www.cisco.com/en/US/products/hw/contnetw/ps789/products_tech_note09186a00801e1dfb.shtml

    =============================================================================
    no set CONTINUE_ON_ERROR
    no set EXIT_MSG

    !--- Make sure the user has the proper number of arguments.

    if ${ARGS}[#] "LT" "3"
    echo "Usage: ap-kal-httpcheck \'WebSiteIP WebPage WebString
    [Port]\'"
    exit script 1
    endbranch


    !--- Set variables corresponding to the args.

    set WebSite "${ARGS}[1]"
    set WebPage "${ARGS}[2]"
    set WebString "${ARGS}[3]"
    set WebPort "80"
    if ${ARGS}[#] "GT" "3"
    set WebPort "${ARGS}[4]"
    endbranch

    echo "Requesting ${WebPage} from ${WebSite} on port ${WebPort}."


    !--- Connect to the remote server.

    set EXIT_MSG "Connect: Failed. Could not connect to ${WebSite} on
    port ${WebPort}"
    set CONTINUE_ON_ERROR "1"
    socket connect host ${WebSite} port ${WebPort} tcp
    if ${STATUS} "NEQ" "0"
    exit script 1
    endbranch
    no set CONTINUE_ON_ERROR


    !--- Request the desired Web page.

    set EXIT_MSG "Send: Failed. Could not send to ${WebSite}:${WebPort}"
    socket send ${SOCKET} "GET ${WebPage} HTTP/1.0\n\nHost:
    ${WebSite}:${WebPort}\n"


    !--- Look for the Web string.

    set EXIT_MSG "Waitfor: Failed. Did not find [${WebString}]"
    set CONTINUE_ON_ERROR "1"
    socket waitfor ${SOCKET} "${WebString}" case-sensitive
    if ${STATUS} "NEQ" "0"
    exit script 1
    endbranch
    no set CONTINUE_ON_ERROR



    !--- Disconnect from the server.

    no set EXIT_MSG
    socket disconnect ${SOCKET} graceful
    exit script 0
    ==============================================================================
    RT, Nov 23, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Olivier PELERIN

    SSL with backend SSL on CSS 11500

    Olivier PELERIN, Aug 30, 2004, in forum: Cisco
    Replies:
    0
    Views:
    3,661
    Olivier PELERIN
    Aug 30, 2004
  2. Replies:
    0
    Views:
    534
  3. CSS 11500 session log

    , Aug 25, 2006, in forum: Cisco
    Replies:
    3
    Views:
    1,038
  4. Sessions on CSS 11500

    , Mar 28, 2007, in forum: Cisco
    Replies:
    4
    Views:
    814
  5. linguafr

    CSS 11500 Specs

    linguafr, May 12, 2007, in forum: Cisco
    Replies:
    1
    Views:
    438
    Thrill5
    May 12, 2007
Loading...

Share This Page