10-29-2009 07:58 AM
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.
Solved! Go to Solution.
10-30-2009 03:42 AM
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.
11-04-2009 07:44 AM
10-30-2009 03:42 AM
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.
10-30-2009 08:17 AM
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 :
Is this what you were mentioning in your post?
Thank you again Gilles.
Dmitry.
11-01-2009 10:38 PM
recvTimeout
Configured socket receive timeout for this probe
Gilles.
11-02-2009 08:01 AM
Thank you Gilles! You've been a great help.
Will the same type of scripting syntax work on a CSS?
11-03-2009 04:01 AM
The CSS does not use TCL but its own language.
But I believe a similar command does exist for the CSS.
G.
11-03-2009 08:52 AM
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.
11-04-2009 07:44 AM
11-04-2009 07:47 AM
Thank you Gilles!
11-04-2009 12:15 PM
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.
11-05-2009 12:51 AM
Try to escape the character.
So enter something like \?
Gilles.
11-06-2009 08:28 AM
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?__"
11-07-2009 05:27 AM
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.
11-09-2009 03:13 PM
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.
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