Re: Automating TCL script in routers

From: Nick Griffin (nick.jon.griffin@gmail.com)
Date: Sun Dec 10 2006 - 12:55:24 ART


Any way to keep that stored in memory or the like, so when you do a tclquit,
and later perfrom tcl tests again it is still available?

R1(tcl)#proc ping_all {} {
+>(tcl)#foreach address {
+>(tcl)#192.168.72.2
+>(tcl)#192.168.72.7
+>(tcl)#192.168.46.6
+>(tcl)#192.168.46.4
+>(tcl)#} { ping $address} }

R1(tcl)#ping_all

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.72.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/61/68 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.72.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/59/60 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.46.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/118/132 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.46.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/116/120 ms
R1(tcl)#tclquit
R1#tclsh
R1(tcl)#ping_all
invalid command name "ping_all" ^
% Invalid input detected at '^' marker.

Thanks!

On 12/9/06, Brian Dennis <bdennis@internetworkexpert.com> wrote:
>
> As far as reusing the script goes have you tried using a procedure?
>
> Rack1R4#tclsh
> Rack1R4(tcl)#proc ping_all {} {
> +>foreach address {
> +>192.168.1.1
> +>192.168.2.2
> +>192.168.3.3
> +>} { ping $address} }
>
> Rack1R4(tcl)#ping_all
>
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max = 120/120/120
> ms
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60 ms
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.3.3, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60 ms
> Rack1R4(tcl)#
> Rack1R4(tcl)#ping_all
>
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max = 116/118/120
> ms
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max = 56/59/60 ms
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.3.3, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max = 56/59/60 ms
> Rack1R4(tcl)#
>
>
>
> Brian Dennis, CCIE4 #2210 (R&S/ISP-Dial/Security/SP)
> bdennis@internetworkexpert.com
>
> Internetwork Expert, Inc.
> http://www.InternetworkExpert.com
> Toll Free: 877-224-8987
> Direct: 775-745-6404 (Outside the US and Canada)
>
>
>
> -----Original Message-----
> From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
> Radioactive Frog
> Sent: Saturday, December 09, 2006 3:28 PM
> To: Cisco certification
> Subject: Automating TCL script in routers
>
> Hi Gang,
>
> Is it possible to automate a TCL script in Cisco Routers?
> For example:
>
> If I saved in router and should run after every 10 minutes?
>
>
>
> Frog.
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html



This archive was generated by hypermail 2.1.4 : Tue Jan 02 2007 - 07:50:37 ART