12-20-2004 09:16 AM
We are in the process of installing newly acquired CSM modules in order to load-balance internal traffic to a set of Telnet servers. The Telnet servers interact with other application servers hosting an in-house developed application that is causing an intermittent problem. When a user connects to a Telnet server, a Telnet sessions sometimes get established without a prompt. We are looking for a way to rectify this problem by using the probing feature on the CSMs. We would like to configure the CSMs to remove the Telnet servers that are experiencing this problem from service. This problem cannot be fixed by setting up a simple Telnet probe, because the badly behaving server will still respond to these probes although the prompt is not being displayed.
An HTTP application level problems can be probed by the CSMs using the HTTP Return Code Checking feature. This is due to the nature of the HTTP protocol where the error codes are displayed in the HTTP header. The CSMs are capable of parsing the HTTP packets and reading the error codes. This feature can be used to certain extent with FTP and Telnet. Could it be used to fix this particular problem? How? If not, do you have other suggestions?
Thanks,
Bachir Najm
12-20-2004 03:23 PM
You can accomplish this with a TCL script. Reference:
http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/cfgnotes/csm_3_1/advcfig.htm#wp1068848
~Zach
12-20-2004 08:29 PM
The trick here is to find a way to detect that the Telnet session is not returning a user prompt. Could you please be more specific on how can this be accomplished by using TCL script?
Thanks
12-21-2004 03:04 AM
Using a Tcl script as a health probe on the CSM allows you to open a connection to a host, send/receive data on that connection, and parse through the responses you receive.
So, you could write a Tcl script that opens a telnet connection to the server, and tries to match against the expected prompt string. If the match fails, you can set an error condition in the script.
Download the file 'c6slb-apc.3-1-9.tcl' from here:
http://www.cisco.com/cgi-bin/tablebuild.pl/cat6000-csm
It contains a set of sample scripts that can be used on the CSM.
~Zach
12-21-2004 04:15 AM
Something like this should work, although I need to test it (This assumes the server prompt is 'GoodServer:'):
set ip $csm_env(realIP)
set port 23
set sock [ socket $ip $port ]
fconfigure $sock -buffering none
set line [ read $sock ]
if { [ regexp "Data: GoodServer:\\r\\n" $line match prompt ] } {
puts "real $ip prompt : $prompt"
}
close $sock
if { $prompt == "Data: GoodServer:\r\n" } {
exit 5000 }
else {
exit 5001
}
12-21-2004 08:21 AM
I want to thank you for providing these answers. This is much more then I expected. I have used TCL scripts before for other purposes; I didnt know I could use it for this purpose as well.
Again, thank you,
Bachir Najm
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide