cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
808
Views
9
Helpful
5
Replies

Telnet Prompt and CSM Probing

bnajm
Level 1
Level 1

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

5 Replies 5

seilsz
Level 4
Level 4

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

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

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

}

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 didn’t know I could use it for this purpose as well.

Again, thank you,

Bachir Najm

Review Cisco Networking for a $25 gift card