From: Rob Webber (rwebber@xxxxxxxxxxxx)
Date: Fri Feb 23 2001 - 14:33:30 GMT-3
I saw a discussion about Hyperterm and Tera Term a few weeks ago. I had no
idea so many people liked Tera Term as much as I did. For the record, I used
Tera Term the whole time I was studying except for the last 2 weeks before
my exam. Then I switched to Hyperterm just to get used to the look & feel.
I wrote a useful Tera Term macro. It assumes you are connected to your
terminal server and that you are using that to connect to your routers. This
macro assumes you have the terminal server and 5 other routers, but as you
can see its very easy to add or subtract for the actual number of routers
you have.
This macro automatically gets the running-config and the ip routing table
from all your routers and places into a log file. What could be easier?!?!
It prompts you for the filename; the directory is in the first few lines of
the macro (and can be easily changed to whatever you want). You can easily
add other commands - I created other macros based on this one for IPX, DLSw,
etc.
I found this useful since as I studied each major topic I wanted to record
the results in case I had questions later or if I wanted to review topics.
Since it does everything automatically its also handy in cases such as if
you are studying BGP. You can alter the preference, run the macro, alter the
MED, run the macro, etc. In that case you'd probably also want to include
show ip bgp commands.
My comments and the actual macro are included below. Hopefully this will
save some folks some time - you never have enough of that! If you don't
currently use Tera Term you may want to consider it, I believe it can be
downloaded from www.tucows.com.
Robert M. Webber
Senior Network Consultant
CCIE 6922
Callisma - Building Your Network of the Future. Today.
Cell: 508-254-6400
Pager: 877-964-8111
http://www.callisma.com
To use the macro, simply copy the macro into an editor such as notepad and
save it. I recommend saving it with a ".ttl" extension since that is what
Tera Term will look for by default. I keep my macros right in the Tera Term
default directory, c:\Program Files\TTERMPRO. This macro gets used when you
are connected to your terminal server and have already established
connections to your routers via the terminal server.
To specify the directory you want to place your logs in, simply edit line 2
(and then cut & paste that line into line 6 and 13). The directory you see
is what my laptop uses for its "My documents" folder; obviously you can
change this to whatever you want. You can use whatever you want for the
filename (you aren't restricted to 8 letters). So you can call your log
"OSPF with area summarization.doc" if you want. I usually use the .doc
extension so Word will bring it up if I want to review it later.
The first 16 lines ask for the filename and check to make sure it doesn't
already exist.
Note that you must be in enable mode for this to work since Tera Term is
waiting for the "#" to come back from the router to let it know the router
is ready. The commands:
sendln "term length 0"
wait "#"
sendln "show running-config"
pause 16
sendln "show ip route"
wait "#"
sendln "term length 42"
wait "#"
pause 1
are what get sent to each router. Here is where you can enter whatever
commands you want. I included the "pause 16" (Tera Term waits 16 seconds)
just to make sure Tera Term doesn't overrun the router while the router is
generating its config. Tera Term is supposed to wait for the "#" before
going on, but I found this just seemed to work better.
the commands
send "1"
sendln #13
wait "#"
tell your terminal server to connect to session 1, and send a return. The
return simply gets the router to return its prompt.
The command
sendln #30#$78
wait "#"
sends the ctrl-shift-6 x so that you break back to the term server. As you
can see you then issue a "2" (going to the second connection) and repeat the
whole process. So just adjust these lines based on the number of routers you
are working with.
Good luck!
Here's the macro:
--------------------------
timeout = 120
directory = "C:\Documents and Settings\RMW1\My Documents\My Router configs\"
inputbox "Name of log file for this test:" "CCIE Here I come!"
strconcat directory inputstr
logfilename = directory
directory = "C:\Documents and Settings\RMW1\My Documents\My Router configs\"
:search_logfile
filesearch logfilename
if result=0 goto openlog
inputbox "Enter new filename:" "File already exists!"
strconcat directory inputstr
logfilename = directory
directory = "C:\Documents and Settings\RMW1\My Documents\My Router
configs\"
goto search_logfile
:openlog
logopen logfilename 1 1
sendln "show clock"
wait "#"
sendln "term length 0"
wait "#"
sendln "show running-config"
pause 16
sendln "show ip route"
wait "#"
sendln "term length 42"
wait "#"
pause 1
send "1"
sendln #13
wait "#"
sendln "term length 0"
wait "#"
sendln "show running-config"
pause 16
sendln "show ip route"
wait "#"
sendln "term length 42"
wait "#"
pause 1
sendln #30#$78
wait "#"
send "2"
sendln #13
wait "#"
sendln "term length 0"
wait "#"
sendln "show running-config"
pause 16
sendln "show ip route"
wait "#"
sendln "term length 42"
wait "#"
pause 1
sendln #30#$78
wait "#"
send "3"
sendln #13
wait "#"
sendln "term length 0"
wait "#"
sendln "show running-config"
pause 16
sendln "show ip route"
wait "#"
sendln "term length 42"
wait "#"
pause 1
sendln #30#$78
wait "#"
send "4"
sendln #13
wait "#"
sendln "term length 0"
wait "#"
sendln "show running-config"
pause 16
sendln "show ip route"
wait "#"
sendln "term length 42"
wait "#"
pause 1
sendln #30#$78
wait "#"
send "5"
sendln #13
wait "#"
sendln "term length 0"
wait "#"
sendln "show running-config"
pause 16
sendln "show ip route"
wait "#"
sendln "term length 42"
wait "#"
pause 1
sendln #30#$78
wait "#"
logclose
This archive was generated by hypermail 2.1.4 : Thu Jun 13 2002 - 10:28:58 GMT-3