Guest

Cisco 4600 Series Content Distribution Manager

Configuring a Keepalive Script to Down a Non-Responsive Device in CDM/CR High Availability

Cisco - Configuring a Keepalive Script to Down a Non-Responsive Device in CDM/CR High Availability

Document ID: 4187

Updated: Jan 31, 2006

   Print

Introduction

This document provides a sample CSS keepalive script to be used in a CDM/CR high availability configuration to down a device that is not responding quickly enough. Typically, this will be the CDM that is busy with other operations like importing files, deleting files, and so on.

The web server may respond quickly when a redirection request may take some time as the CDM/CR has to look through its tables. The CSS can be configured to down the device path on the first failure.

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

This document is not restricted to specific software and hardware versions.

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Conventions

For more information on document conventions, see the Cisco Technical Tips Conventions.

Sample Script

Filename: ap-kal-cdm
!
! Parameters: IP_addr webpage [timeout]
!
!   IP_addr is the IP address of the CDM or CR you are testing
!   webpage is the web page you are testing for (see Description)
!   timeout is the maximum time to wait (default is 5000)
!

This script is used as a keepalive to test the responsiveness of the CDM or CR to returning redirects for client HTTP requests. The arguments are the device's address, the webpage to test for, and a timeout (in milliseconds). If no timeout is given, 5000 is used as default.

The webpage needs to be a page that will remain on the CDM. Look at the CE_Play URL for the page in the Previewer. All characters following the http://host:port/ are what you need to include in this parameter. For example, if the CE_Play link was:

http://10.0.2.50/Cisco/00b0d0ab1f84/Default_Channel/here.gif

You would specify the following for the webpage parameter to this script:

/Cisco/00b0d0ab1f84/Default_Channel/here.gif

If there is no valid response from the device within the specified timeout, the script failed.

Below is the final portion of the script.

! no echo
set USAGE_MSG "Usage: ap-kal-cdm \'IP_addr webpage [timeout]\'"
set Wait_str "HTTP"
! Gather arguements.
! At least two arguments (IP_addr and webpage) must be specified.
! If no timeout is specified, a default 5000 miliseconds is used.
set EXIT_MSG "${USAGE_MSG}"
if ${ARGS}[#] "LT" "2"
exit script 1
endbranch
set IP_addr "${ARGS}[1]"
set webpage "${ARGS}[2]"
set timeout "5000"
if ${ARGS}[#] "==" "3"
set timeout "${ARGS}[3]"
endbranch
if ${ARGS}[#] "GT" "3"
exit script 1
endbranch
no set EXIT_MSG
! Make a connection
set EXIT_MSG "Connect failed"
socket connect host ${IP_addr} port 80 tcp
! Send GET request
set EXIT_MSG "Send GET request failed"
socket send ${SOCKET} "GET ${webpage} HTTP/1.0\n"
socket send ${SOCKET} "Host: ${IP_addr}\n"
socket send ${SOCKET} "Pragma: no-cache\n"
socket send ${SOCKET} "\n"
! Wait for timeout
set EXIT_MSG "Timeout or bad response"
socket waitfor ${SOCKET} "${Wait_str}" ${timeout}
no set EXIT_MSG
socket disconnect ${SOCKET}
exit script 0

Related Information

Updated: Jan 31, 2006
Document ID: 4187