cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1083
Views
0
Helpful
13
Replies

CSM and custom TCL scripts.

dtochilovsky
Level 1
Level 1

Hello all, I am running a CSM version 3.1(6).

I was asked to create custom probe that can use a set of credentials to log in to a web service and measure the time it takes for a response.

Please let me know if it is even possible with the TCL scripts, I suspect not, but wanted to hear from someone that has more knowledge of the custom scripting on the CSM.

Thank you.

Dmitry.

2 Accepted Solutions

Accepted Solutions

Gilles Dufour
Cisco Employee
Cisco Employee

This should be possible.

I see at least 2 different ways of doing it.

One is to sniff a connection where you do what you expect the script to do.

Then extract from the sniffer trace the hexadecimal data representing the HTTP Request.

Create a script to send that hexadecimal data.

You could also create the same data in cleartext manually in a variable and ask the script to simply send it.

Then you have to analyze the response.

You can't really measure the time, but I believe you can set the max amount of time to wait for the response.

Gilles.

View solution in original post

13 Replies 13

Gilles Dufour
Cisco Employee
Cisco Employee

This should be possible.

I see at least 2 different ways of doing it.

One is to sniff a connection where you do what you expect the script to do.

Then extract from the sniffer trace the hexadecimal data representing the HTTP Request.

Create a script to send that hexadecimal data.

You could also create the same data in cleartext manually in a variable and ask the script to simply send it.

Then you have to analyze the response.

You can't really measure the time, but I believe you can set the max amount of time to wait for the response.

Gilles.

Thank you Gilles.

This gives me hope! :)

A follow up question regarding the time to wait for a response. I see that on the CSM you can only set the timeout for a TCP connection via the "open" command as described in this page :

http://www.cisco.com/en/US/docs/interfaces_modules/services_modules/csm/3.1/configuration/guide/helthmon.html#wp1024967

Is this what you were mentioning in your post?

Thank you again Gilles.

Dmitry.

Thank you Gilles! You've been a great help.

Will the same type of scripting syntax work on a CSS?

The CSS does not use TCL but its own language.

But I believe a similar command does exist for the CSS.

G.

Hi Gilles, thank you for the info. I've been looking around Cisco's site to find the CSS scripting language details, like variables, but as yet to find any definitive guide.

I've only found some sample scripts.

Would you be able to point me to some document that details the CSS scripting language so I can create my own custom CSS scripts?

Thank you again for all your help.

Dmitry.

Thank you Gilles!

Hi Gilles, I figured out the clear text data that could be sent to the server that will simulate a login. I am trying to put that URL string into the regular HTTP probe with the "request method get url" command.

The problem I am running into is that the URL string contains a "?" and the CSM seems to strip that character, so if I look at the probe URL string it is missing the "?" character.

Are there any restrictions on using special characters inside of a URL string, like "login.aspx?__VIEWSTATE..."?

Dmitry.

Try to escape the character.

So enter something like \?

Gilles.

Gilles, I tried that but it still does not appear in the URL string, it shows up as "login.aspx\__" instead of what I need it to look like - "login.aspx?__"

you can enter a binary request if you want.

There is an example inside the ldap script.

You won't need the question mark.

Gilles.

Thank you Gilles I finally got the script to run properly and to accept the "?" inside the script.

I was using HTTP 1/1 inside the URL string, and the server was erroring out expecting a hostname, fixed it by using HTTP 1/0.

Thanks for all your help!!!

Dmitry.

Review Cisco Networking for a $25 gift card