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. And see here for current known issues.

New Member

Using KAL to monitor app server behind CSS

We have had issues in the past where the app server has crashed and the CSS would keep sending connections to the front end webserver.

I am trying to find a way to monitor/keepalive based on the availability of an app server. The webserver is acting as a database app server front end.

I would like to be able to use the CSS to send a fixed set of (form style or XML) input to the ASP webserver so that it will return an expected output (from the app server) that can be hashed. The GET hash comparison will tell the CSS that the app server is correctly responding to the input.

Any one have any experience with things like this?

Carl

2 REPLIES
New Member

Re: Using KAL to monitor app server behind CSS

Carl,

simply having the web server run a script getting data from the APP server should work. If the response is always identical if the app server is up, you can use the standard GET keepalive.

If not, you will need some script that checks the response for a specific string.

Hope that helps,

Steve

New Member

Re: Using KAL to monitor app server behind CSS

Thanks Steve,

I created a script that I think will do what I want, but I am not really clear on a couple of points.

I could not find anything to expand on the syntax for the socket send command. I noticed that some scripts that were posted used what seems like a directive to use the GET method but did not include any input.

socket send ${SOCKET} "GET ${webpage} http1.0\n\n"

It seems there may be some undocumented arguments to the socket commands. How do I find them?

I need to send an XML query as if it came from a form so the webserver will return the webpage I expect it to. The script I have so far is;

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

! Filename: ap-kal-dbstat

! Parameters: None - must be coded in script

!

! Description:

!

! This script will attempt to connect to a web server

! front end to a database host and

! "GET" an html page with dynamic content. The "sendstring"

! is some XML query which should return an expected output.

! The script checks the contents of the page for the returnstring.

! If found, the script passes.

!

! Failure Upon:

! 1. The correct arguments are not supplied.

! 2. The CSS is unable to connect to the host.

! 3. The string is not found in the return page.

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

no echo

if ${ARGS}[#] "LT" "5"

echo "Usage: ap-kal-dbstat \'Hostname Port Page Sendstring Returnstring\'"

echo "Example: ap-kal-dbstat \'10.1.1.1 80 webpage.asp XML=string form-element\'"

exit script 1

endbranch

set host "${ARGS}[1]"

set port "${ARGS}[2]"

set page "${ARGS}[3]"

set sendstring "${ARGS}[4]"

set returnstring "${ARGS}[5]"

set EXIT_MSG "Host ${host} not responding on TCP port ${port}."

socket connect host ${host} port ${port} tcp session

set EXIT_MSG "Socket string: String sent."

socket send ${SOCKET} "GET ${webpage} ${sendstring}"

set EXIT_MSG "Socket->Waitfor returnstring not found or timed out waiting."

socket waitfor ${SOCKET} "${returnstring}" 500

set EXIT_MSG "Socket: disconnected"

socket disconnect ${SOCKET}

echo "String ${returnstring} was found."

no set EXIT_MSG

exit script 0

Does this look like it will achieve my objective?

Carl

97
Views
0
Helpful
2
Replies
CreatePlease login to create content