From: Alexis Dacquay (alexis.dacquay@gmail.com)
Date: Thu Apr 10 2008 - 10:20:13 ART
1) configuration
tclsh
set file [open "flash:script" WRONLY]
puts $file "
hello world"
close $file
exit
2) verification
more flash:script
hellow world
Regards,
Alexis
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of Huan
Pham
Sent: 10 April 2008 03:56
To: 'Joseph Brunner'; laidlaw@consecro.com; 'John Jones'
Cc: ccielab@groupstudy.com
Subject: RE: Saving a TCL ping script to flash
Yeah, it is a great tip, that I've been looking for.
However, I still see one issue. In the lab, we most likely do not have
access to a PC that is connected to the lab via one of the four lab
switches. The PC we have is connected to the terminal server, then via
console ports to routers/switches. So copy txt file from a workstation to
router flash, or try to load TCL script from a TFTP, FTP servers are not
feasible in the lab.
My question is:
How to edit and save a text file to flash?
(we can view the text file on flash using "more" IOS command)
Cheers,
Huan
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Joseph Brunner
Sent: Thursday, 10 April 2008 12:38 PM
To: laidlaw@consecro.com; 'John Jones'
Cc: ccielab@groupstudy.com
Subject: RE: Saving a TCL ping script to flash
Now that made my day.
Rob, you are the man!
Has to be the best GS post in years...
-Joe
Adv. Beginner #19366
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
laidlaw@consecro.com
Sent: Wednesday, April 09, 2008 4:54 PM
To: John Jones
Cc: ccielab@groupstudy.com
Subject: RE: Saving a TCL ping script to flash
I copy the tcl file from my host to the router.
host> cat bulkping.tcl
proc bulkping {
foreach address {
172.12.23.2
172.12.23.3
172.12.23.4
172.12.23.6
172.12.23.7
} { ping $address re 10 si 1500
}}
host>
On my router
Rack1R1#
Rack1R1#copy tftp://x.x.x.x/bulkping.tcl disk0:
Destination filename [bulkping.tcl]?
Accessing tftp://x.x.x.x/bulkping.tcl...
Loading bulkping.tcl from x.x.x.x (via FastEthernet0/0): !
[OK - 764 bytes]
764 bytes copied in 0.152 secs (5026 bytes/sec)
Rack1R1#
Rack1R1#tclsh
Rack1R1(tcl)#bulkping
invalid command name "bulkping" ^
% Invalid input detected at '^' marker.
Rack1R1(tcl)#
Rack1R1(tcl)#
Rack1R1(tcl)#source disk0:/bulkping.tcl
Rack1R1(tcl)#
Rack1R1(tcl)#bulkping
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.2, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 4/4/4 ms
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.3, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 4/4/4 ms
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.4, timeout is 2 seconds:
..........
Success rate is 0 percent (0/10)
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.6, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.7, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 1/3/4 ms
Rack1R1(tcl)# tclquit
Alternatively to calling it each time in tclsh, you can add t he global
command:
Rack1R1#
Rack1R1#
Rack1R1#tclsh
Rack1R1(tcl)#bulkping
invalid command name "bulkping" ^
% Invalid input detected at '^' marker.
Rack1R1(tcl)#
Rack1R1(tcl)# tclquit
Rack1R1#
Rack1R1#
Rack1R1#conf t
Rack1R1(config)#scripting tcl init flash://bulkping.tcl
(alternatively)
(Rack1R1(config)#scripting tcl init
ftp://user:password@x.x.x.x/tclscript/bulkping.tcl
)
Rack1R1(config)#exit
Rack1R1#
Rack1R1#tclsh
Rack1R1(tcl)#
Rack1R1(tcl)#
Rack1R1(tcl)#bulkping
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.2, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 4/4/4 ms
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.3, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 4/4/4 ms
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.4, timeout is 2 seconds:
..........
Success rate is 0 percent (0/10)
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.6, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 172.12.23.7, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 1/3/4 ms
Rack1R1(tcl)#
Rack1R1(tcl)# tclquit
Rack1R1#
HTH
-Rob
-------- Original Message --------
Subject: Saving a TCL ping script to flash
From: "John Jones" <acer0001@gmail.com>
Date: Tue, April 08, 2008 8:10 pm
To: ccielab@groupstudy.com
Hey all -
Is there a way to save a TCL script, such as a ping script, on a
router in a
flash file and then call it in TCLSH mode to run? Or is cut-n-paste
from
Windows Notepad really the only way to do this. I guess I am looking
for
more efficiency when doing connectivity testing.
John
_______________________________________________________________________
Subscription information may be found at:
http://www.groupstudy.com/list/CCIELab.html
Pass the CCIE in six weeks, Guaranteed!
http://www.certscience.com/CCIE
This archive was generated by hypermail 2.1.4 : Thu May 01 2008 - 08:25:50 ART