Re: TCL Script help

From: Rick Mur (rick@rickmur.com)
Date: Wed Dec 10 2008 - 07:55:07 ARST


Of course you could just do a ping to each and every IP address in your
topology.
The easiest thing to do is just create a TCL script in Notepad and paste it
in a router. It takes only 10 minutes to make, but it's really benifitial.

Because the terminal application in the lab is SecureCRT you can select a
specific column of output. What I do when I start a lab is do a: 'sh ip int
brie | ex unas', hold down the Alt key and select the column with IP
addresses. Then you can paste it in Notepad and create your little
TCL-script around it. Just as easy as Jason said

foreach i {
10.0.0.1
10.0.0.2
} { ping $i re 2 }

I always do the re 2 behind the ping so your script runs a lot faster (only
have to do 2 pings instead of 5) especially with pings that fail.

Well you can't say that's a lot of work ;-)

Rick Mur
CCIE #21946 (R&S)
CCNP, CCIP, JNCIA-ER, MCSE
rick@rickmur.com

On Wed, 10 Dec 2008 11:03:04 +0200
  "Mohamed El Henawy" <m.henawy@link.net> wrote:
  sounds like doing ping is much easier :)
  
  
  Do we really need to know it in the LAB ?????
  
  
  Regards ,
  
  
  ----- Original Message ----- From: "Jason Madsen"
<madsen.jason@gmail.com>
  To: <yungli2008@gmail.com>
  Cc: <ccielab@groupstudy.com>
  Sent: Saturday, November 29, 2008 8:17 PM
  Subject: Re: TCL Script help
  
  
> not sure about a link at the moment, but I can help with the basic
>syntax
> for doing ping tests. it's quite easy actually.
>
> to get into TCL mode:
>
> en
> tclsh
>
> to do a ping test (replace "ip" with whatever you want):
>
> foreach ip {
> x.x.x.x
> x.x.x.x
> x.x.x.x
> x.x.x.x
> } {ping $ip}
>
> (replace "$ip" with "$" and whatever variable you used after
>"foreach" and
> replace "x.x.x.x" with the IPs you want to ping). "show ip alias" is
>a
> great way to get an IP listing for each of your devices. it puts the
>IPs
> in
> a neater format than "show ip interface brief". when using Secure
>CRT you
> can select a column of text by holding down "alt" and then selecting
>your
> text.
>
> enter "exit" or "tclquit" to get out of tcl mode.
>
> Jason
>
>
> On Sat, Nov 29, 2008 at 11:09 AM, <yungli2008@gmail.com> wrote:
>
>> Hi experts
>>
>> I am completely new in TCL Script programming in CISCO IOS.
>> I am wondering if anyone give some good link for beginners in TCL
>>script.
>>
>> I appreciate your help.
>> Thanks
>> Li
>>
>>
>> Blogs and organic groups at http://www.ccie.net
>>
>> _______________________________________________________________________
>> Subscription information may be found at:
>> http://www.groupstudy.com/list/CCIELab.html
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
  
  
  Blogs and organic groups at http://www.ccie.net
  
  _______________________________________________________________________
  Subscription information may be found at:
http://www.groupstudy.com/list/CCIELab.html

Blogs and organic groups at http://www.ccie.net



This archive was generated by hypermail 2.1.4 : Thu Jan 01 2009 - 12:53:08 ARST