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

CSM and custom TCL scripts.

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
Cisco Employee

Re: CSM and custom TCL scripts.

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.

Cisco Employee
13 REPLIES
Cisco Employee

Re: CSM and custom TCL scripts.

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.

New Member

Re: CSM and custom TCL scripts.

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.

Cisco Employee

Re: CSM and custom TCL scripts.

New Member

Re: CSM and custom TCL scripts.

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

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

Cisco Employee

Re: CSM and custom TCL scripts.

The CSS does not use TCL but its own language.

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

G.

New Member

Re: CSM and custom TCL scripts.

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.

Cisco Employee
New Member

Re: CSM and custom TCL scripts.

Thank you Gilles!

New Member

Re: CSM and custom TCL scripts.

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.

Cisco Employee

Re: CSM and custom TCL scripts.

Try to escape the character.

So enter something like \?

Gilles.

New Member

Re: CSM and custom TCL scripts.

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?__"

Cisco Employee

Re: CSM and custom TCL scripts.

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.

New Member

Re: CSM and custom TCL scripts.

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.

426
Views
0
Helpful
13
Replies
CreatePlease login to create content