Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

CSS Script to search for a specific Keyword for keepalive

Hello

I am trying to figure out if this is possible. I want the CSS to check a web page for a specific word such as "ClientABC" any where in the page. If the word is found, then CSS will assume that page is working fine.

The reason for this is: we want to know if database does not send the output to the page, CSS should tell us that.

I found one script close to this but not sure if this will help me at all..

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

!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

! 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"

no set EXIT_MSG

socket disconnect ${SOCKET}

exit script 0

2 REPLIES
New Member

Re: CSS Script to search for a specific Keyword for keepalive

I see no way to set that up in the docs. You could ask Cisco or at least put in an enhancement request.

New Member

Re: CSS Script to search for a specific Keyword for keepalive

Hi there !

I am not sure about the current status of your investigation but I believe there are a number of ways to do what you want by just using the http keepalives / get statement.

I think that what you really want to do is to monitor the database connection and for this you can create a test page (asp) that connects to the backend db and returns either a 'success' or 'failed'.

The page contents only change on failure causing the CSS to pull that webserver out of the cluster.

Regards,

Leonel

133
Views
0
Helpful
2
Replies