RE: CCIE -lab - scripts .

From: Wayne Hines (wayneh@DataNetDev.com.au)
Date: Thu Feb 19 2004 - 11:23:24 GMT-3


Hello Rahul,

The only issue I found on running a tcl script similar to [yours] below on a
locked down desktop is that if the output exceeds the buffer limit of the
terminal emulator the first xxx lines are lost. There are a few ways to
counter this such as
conf t
line vty 0 4
!or line con 0
length 25
end

but this is not ideal as it will suspend your script and requires you to
change your config.

To improve on this would require the ability to communicate via file
systems. eg

eg 1) to pause a script without changing the line length on the router
set answer [gets stdin]

eg 2) to dump output to a file
set f "flash:\test.txt"
set x [open $f a]
puts $x [rsh $i ping $j]
close $x

Does anyone know [or can they test] if the tcl on a multiservice router
(26xx, 36xx) will support stdin and/or file system access for dumping the
output to a file somewhere in the filesystem, so that the output can be read
back with more?

Following a more complete scripts
Script 1 - standard ping all from all routers and sh ip route script
tclsh
foreach i {
 1.1.1.1
 1.1.1.2
} {
 puts "****************$i***********************"

 rsh $i sh ip route
 foreach j {
  1.1.1.1
  10.1.1.1
  11.1.1.1
  12.1.1.1
  13.1.1.1
  1.1.1.2
  20.1.1.1
  21.1.1.1
  22.1.1.1
  23.1.1.1
 } {
  rsh $i ping $j
 }
}
tclquit

Script 2 - attempt [unverified] to use file systems
tclsh
set f "flash:\\test.txt"
set x [open $f a]
foreach i {
 1.1.1.1
 1.1.1.2
} {
 puts $x "****************$i***********************"

 puts $x [rsh $i sh ip route]
 foreach j {
  1.1.1.1
  10.1.1.1
  11.1.1.1
  12.1.1.1
  13.1.1.1
  1.1.1.2
  20.1.1.1
  21.1.1.1
  22.1.1.1
  23.1.1.1
 } {
  puts $x [rsh $i ping $j]
 }
 set answer [gets stdin]
}
close $x

tclquit
more flash:\test.txt

!Note 1
!could use more nvram:\test.txt instead

!Note 2
!more will still require changing of the router's line length, but at least
[if the script works] the output can be reviewed when you are ready and not
have to watch the script run.

ie - if anyone has a [non production] multiservice router accessible, we all
would be greatful if script 2 could be tested!!

Wayne

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com]On Behalf Of
Rahul Barua
Sent: Sunday, 8 February 2004 4:01
To: ccielab@groupstudy.com
Subject: CCIE -lab - scripts .

Dear Kasturi ,
Any help is always appreciated . any ways i am yet far away from 8hr
sessions.
wat i really wanted to ask for is small tricks n tips , well one of my ccie
freinds says
ccie is a fight against time ,the more u save ,the better coz u can review
ur
configs .
Th script he asked me to use is :

tclsh
foreach test {
10.1.1.1
10.2.2.2
10.3.3.3
10.4.4.4
} {ping $test} ps: works on 12.2t and above n mostly seen on 26xx (yet to
see
a 25xx with it)

This way for checking end to end connectivity i don't have to type in more
key
storkes .
just one script and test it on all the routers well saves 15 min , just type
all ips in
a note pad along with the script and boy u r not waiting for a ping to
finish
to resume another one .
well i just wanted to know if there are other similar short tricks that
could
make life easier .
i bet this script will sure help a lotta guys who din't know {if people like
that exist on this forum}.
well i use a long list of alias commands and practice to type them in just
abt
10 min .so that i can save time .
well i have made this post before but just if someone missed it here it is
again .

alias configure ac alias configure
ac ae alias exec
ac ai alias interface
ac as alias subinterface

ai i ip address
ai ns no shut
ai cr clock rate
ai e exit
ai ef encapsulation frame-relay
ai ep encapsulation ppp
ai fm frame-relay map ip
ai fi frame-relay interface-dlci
ai nfi no frame-relay inver
ai frts frame-relay traffic-shap

as i ip address
as ns no shut
as cr clock rate
as e exit
as ef encapsulation frame-relay
as ep encapsulation ppp
as fm frame-relay map ip
as fi frame-relay interface-dlci
as nfi no frame-relay inver
as frts frame-relay traffic-shap

ac r router rip
ac e router eigrp
ac o router ospf
ac is router isis
ac b router bgp
ac a access-list
ac na no access-list
ac ia ip access-list
ac nia no ip access-list
ac i interface
ac rm route-map
ac nrm no route-map
ac di default interface

ae a sh access-list
ae b sh runn | begin
ae c conf t
ae sr sh runn | e alias
ae s sh ip inter brief | e unass
ae si sh ip route
ae i sh runn interface
ae sp sh ip protocols
ae sf sh frame-relay
ae sn sh isdn
ae sa sh atm
ae so sh ip ospf
ae se sh ip eigrp
ae sb sh ip bgp
ae sm sh ip mroute
ae ci clear ip route *
ae co clear ip ospf process
ae cb clear ip bgp *
ae sb sh ip bgp
ae nd undebug all
ae d debug
ae dci debug condition inteface
ae ndc no debug condition interface
ae sc show controller serial

ae v sh vlan
ae sis sh interface status
ae st sh inter trunk
ac vd vlan database
ae sec show ether

no ip domain lookup

line con 0
logg sync
exec-t 0 0

lin vty 0 4
logg sync
exec-t 0 0

Regards

Rahul Barua .

" Do,Or do not.There is no try . " - Yoda .



This archive was generated by hypermail 2.1.4 : Fri Mar 05 2004 - 07:13:51 GMT-3