CSM and custom TCL scripts.

Answered Question
Oct 29th, 2009
User Badges:

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.


Correct Answer by Gilles Dufour about 7 years 7 months ago

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
Gilles Dufour Fri, 10/30/2009 - 03:42
User Badges:
  • 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.

dtochilovsky Fri, 10/30/2009 - 08:17
User Badges:

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.

dtochilovsky Mon, 11/02/2009 - 08:01
User Badges:

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


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

Gilles Dufour Tue, 11/03/2009 - 04:01
User Badges:
  • Cisco Employee,

The CSS does not use TCL but its own language.

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


G.

dtochilovsky Tue, 11/03/2009 - 08:52
User Badges:

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.

dtochilovsky Wed, 11/04/2009 - 12:15
User Badges:

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.

Gilles Dufour Thu, 11/05/2009 - 00:51
User Badges:
  • Cisco Employee,

Try to escape the character.

So enter something like \?


Gilles.

dtochilovsky Fri, 11/06/2009 - 08:28
User Badges:

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

Gilles Dufour Sat, 11/07/2009 - 05:27
User Badges:
  • Cisco Employee,

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.

dtochilovsky Mon, 11/09/2009 - 15:13
User Badges:

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.

Actions

This Discussion