cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3035
Views
0
Helpful
5
Replies

Cisco css http keepalive is not working with GET command

muhammad feroz
Level 1
Level 1

Dear all

i have Cisco Css connected to Dell Server (via switch)

Cisco CSS - 192.168.1.3 and Dell Server - 192.168.1.5

Dell server is setup with windows 2009R2 and Apache HTTPD is version 2.2

This server is dedicated to host multiple doamins with Apache lik

www.abc.co.uk

www.xyz.co.uk

Now the clinet wants to setup the http keepalive  with specfic web page like /testpage.html  for all these domains. i have teseed with single URI. it is working the comamnds are

config)# service serv1

(config-service[serv1])# ip address 192.168.1.5

(config-service[serv1])# keepalive type http

(config-service[serv1])# keepalive method head    ( get i have not used due to hash mismatch with apche server, if i use GET it is not working)

(config-service[serv1])# keepalive uri "/testpage.html"

(config-service[serv1])# active

It is working with single URI.  but how can i do the same thing for multiple doamins ?

for multiple doamins do i need use script ? or can i use with commands ?

if i need to use script the script is

------------------------------------

!no echo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Filename: httptag-test
! 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: httptag-test \'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

! Send the GET request for the web page
set EXIT_MSG "Send: Failed"
socket send ${SOCKET} "GET ${WebPage} HTTP/1.1\nHost: ${HostTag}\n\n"

! Send the HEAD request for the web page
set EXIT_MSG "Send: Failed"
socket send ${SOCKET} "HEAD ${WebPage} HTTP/1.1\nHost: ${HostTag}\n\n"


! Wait for a good status code
set EXIT_MSG "Waitfor: Failed"
socket waitfor ${SOCKET} "200 OK"

no set EXIT_MSG
socket disconnect ${SOCKET}sh w

exit script 0
-----------------------

in the script i have not used GET becasue, when CSS send GET request to apache it use hash, but apache is not able to respond with same hash and it shows that website is down. more information- click below url

http://www.cisco.com/en/US/docs/app_ntwk_services/data_center_app_services/css11500series/v7.40/command/reference/CmdKeepC.html#wp1139668

(config-keepalive) method

-------------------------------------

I have uploaded in CSS with httptag-test file and applied these commands

service comp.brit.co.uk-80

  keepalive port 80

  ip address 192.168.1.5

  keepalive frequency 10

keepalive maxfailure 2

keepalive retryperiod 10

keepalive type script httptag-test "192.168.1.5 /testpage.html  www.abc.co.uk

keepalive type script httptag-test "192.168.1.5 /testpage.html  www.xyz.co.uk

-----------------

but this script is not working

my question is:

1.do i need use script only to setup http keepalvie with webpage for multiple domains ?

2.with out using script is there any solution like CICSCO  CSS commands  to setup http uril for multiple domains which are on 1 singl server.

please help me asap

5 Replies 5

Daniel Arrondo Ostiz
Cisco Employee
Cisco Employee

Hi Muhammad,

If you need to poll different URI for one single server, then, the only way to do it is using a scripted keepalive.

Regards

Daniel

Dear Daniel

Thanks for your reply but the script is not working with head command.

Can you please check this script, is there any mistake in this script ? please let me know.

no echo

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! Filename: httptag-test

! 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: httptag-test \'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

! Send the GET request for the web page
set EXIT_MSG "Send: Failed"

socket send ${SOCKET} "HEAD ${WebPage} HTTP/1.1\nHost: ${HostTag}\n\n"


! Wait for a good status code
set EXIT_MSG "Waitfor: Failed"
socket waitfor ${SOCKET} "200 OK"

no set EXIT_MSG
socket disconnect ${SOCKET}sh w

exit script 0
-----------------------

Please help me

Hello Muhammad,

If you wish to use multiple domains for a URI  keep-alive check, and perform a HEAD request what Daniel mentioned is  correct.  You have to use a scripted keep-alive check on the service.  However, you should not use the default "ap-kal-httptag" script to do so  as it's limited to only 1 website (unless you modify the script).  You're best bet would be using the "ap-kal-httplist" script on the CSS  as it allows the checking of 2 different websites along with a webpage  to check for each site using HTTP HEAD method.

!no echo

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! Filename: ap-kal-httplist

! Parameters: Site1 WebPage1 Site2 WebPage2 [...]

!

! Description:

!    This script will connect a list of sites/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 Page "${ARGS}[1]"

    var-shift ARGS

    no set EXIT_MSG

    function HeadUrl call "${Site} ${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 80 tcp 2000

! Send the head request

set EXIT_MSG "Send: Failed to send to ${ARGS}[1]"

socket send ${SOCKET} "HEAD ${ARGS}[2] 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

Rather  then modify the default "ap-kal-httplist" script on the CSS I would  simply define the arguments within the service configuration itself.   Something like the following (using your service example):

service dell-192.168.1.5

ip address 192.168.1.5

keepalive type script ap-kal-httplist "www.abc.co.uk /testpage.html www.xyz.co.uk /testpage.html"

active

As  long as the server is configured to reply to host headers, and the page  is configured to retuen a "200 OK" the above service configuration  should work. If there are any errors simply run "show service  " to view why there was a failure. If there is a  failure, and the output from the command specified shows a line number  run the following command against the script to view at what point  (line) did the failure occur:

show script ap-kal-httplist line-numbers

Hope this helps!

- Jason Espino

I have tried this, but still not working. l will replace the server with IIS, than i try again ?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: