to TCL or not to TCL that is the question.

Unanswered Question
Apr 7th, 2008

While in my pursuit of CCIE R&S, I have been running into a lot of people that ask me if use TCL to test my connectivity. So I took a look at how to use TCL to test with ping. While it does look to test connectivity faster than doing it by hand, I still don't really see the point. If you test each piece as you go, why bother with it? Any thoughts that you have either for or against TCL are appreciated. I don't want to burn brain cycles on something that I don't really need to know how to do.

Steve

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
Loading.
mohammedmahmoud Mon, 04/07/2008 - 12:59

Hi Steve,

Actually i agreed with your point at first, then i though why not giving it a try, opening a notepad writing the script in it, then copy and paste it to all the routers at the same time and in a couple of minutes i found out which network(s) is suffering problems, well after practicing this many times and reaching a simple syntax i guess it is very helpful, and i've indeed used it in the exam.

Here is the script i use:

router#tclsh

router(tcl)#

router(tcl)#foreach CCIE {

+> 10.1.1.1

+> 172.17.1.4

+> 111.100.100.1

+> 192.168.10.1

+> 192.168.99.5

+> } {ping $CCIE}

router(tcl)#tclq

And as you know switches don't support TCL but it supports Macros, and here is an example:

Rack6SW1(config)#macro name ping

Enter macro commands one per line. End with the character '@'.

do ping 150.6.1.1

do ping 150.6.7.7

@

Rack6SW1(config)#macro global apply ping

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 150.6.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 150.6.7.7, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

Rack6SW1(config)#

BR,

Mohammed Mahmoud.

jim_berlow Mon, 04/07/2008 - 14:11

I know people on both sides of the argument to use TCL. I didn't use them on my first couple attempts, but then on my later attempts I learned it only so that I would have another tool at my disposal. It is completely up to you whether you want to use it or not. Like you are alluding to, if there are more important things to spend your time on then don't worry about learning TCL. It isn't a requirement to pass the lab.

Hope that helps,

Jim

Hi Mohammed

Excellent post and thanks for the script and macro examples. This is really helpful and deserer a rating.

I am currently only a CCNP student but I would be for the use of tcl scripts to test connectivity. My job is a mixture of Unix system administration and networking so I am used to putting small scripts like this together to automate things like testing connectivity.

Can I ask a couple of questions in regards to tcl scripting and macro use.

It appears that with the macro once I create it, it is there on the switch until I manually remove it and so would be available whenever I want to use it. Is that correct? If the switch reloads is the marco still there or must it be re-created?

However the tcl script looks like it is written on the fly and would need to be pasted into the router each time you want to use it. Is that correct?

I am wondering if there is a way to save a script file to the router, maybe to Flash and execute it whenever you want without having to paste it in each time. Similar to a Unix system?

Best Regards,

Michael

mohammedmahmoud Tue, 04/08/2008 - 01:12

Hi Michael,

Thank you very much, and thanks for the rating.

You can run the TCL from a predefined file, on the flash or via tftp using the "source" command (which i believe is a hidden command), kindly check the below document:

http://www.cisco.com/en/US/docs/ios/12_3t/12_3t2/feature/guide/gt_tcl.html#wp1048017

As for the Macro, it is saved as part of the startup configuration if you save it on the switch.

BR,

Mohammed Mahmoud.

mohammedmahmoud Tue, 04/08/2008 - 02:45

Hi Michael,

You are very welcomed, and thank you for the appreciation.

BR,

Mohammed Mahmoud.

Actions

This Discussion