RE: Ping scripts for routers.

From: Jonathan V Hays (jhays@jtan.com)
Date: Mon Nov 17 2003 - 15:30:08 GMT-3


Sorry about the long post, but a couple of people have emailed me
offlist for an example of what a TCL ping script looks like in action.

Again, the script itself is simple. Once you have it in Notepad, Ctrl+A
will select the script, Ctrl+C will copy the script, and from there you
can paste it into the terminal emulator (SecureCRT at RTP).

Here's one such script I ran not too long ago on a rental rack:

tclsh
foreach i {
172.16.105.1

[output omitted]

172.16.110.1
172.16.46.20
172.16.1.20
172.16.2.20
172.16.120.1
} {ping $i}

BTW, use this command to get out of the TCL prompt:

tclquit

-----
Below is an example copied from a SecureCRT window. All I did was paste
in the TCL script. The successful pings go by very quickly, but you have
to wait 5 seconds (5 pings) for every one that fails. This list has
about 30 routes and when all targets respond to the icmp echo, the whole
thing takes about 10 seconds to complete on that router. What I do is
open another Notepad and paste in the IP addresses of the few pings that
fail. Then I start looking for the cause of the failure.

Once again, this will NOT work on a Catalyst 3550, only a router (not a
2500 series, though).

You may want to remove ISDN interfaces from list, since you generally
won't have ISDN up all the time. The other thing you need to do is map
each router's own interface in ATM and Frame-Relay, that way you won't
be getting a timeout when you try to ping yourself on a given router.
On at least one occasion I've asked the proctor whether it's okay to map
a router's own interface and he basically said that in general, unless
it's prohibited or breaks something else, over-configuring is not marked
against you.

Maybe so, but it never hurts to ask about anything you are planing to
add to your configurations that is not specified in the lab booklet.

-Jonathan

Below is what happens when I paste the script into a router. From the
time I pasted it in until completion was less than 10 seconds.

R1a#
R1a#tclsh
R1a(tcl)#foreach i {
+>172.16.61.1
+>172.16.12.1
+>172.16.11.1
+>172.16.124.1
+>172.16.101.1
+>172.16.25.2
+>172.16.124.2
+>172.16.12.2
+>172.16.102.1
+>172.16.38.3
+>172.16.103.1
+>172.16.34.3
+>172.16.46.4
+>172.16.124.4
+>172.16.34.4
+>172.16.104.1
+>172.16.25.5
+>172.16.105.1
+>10.10.10.1
+>172.16.46.6
+>172.16.61.6
+>172.16.106.1
+>172.16.25.7
+>172.17.107.1
+>172.16.38.10
+>172.16.1.10
+>172.16.2.10
+>172.16.110.1
+>172.16.46.20
+>172.16.1.20
+>172.16.2.20
+>172.16.120.1
+>} {ping $i}

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.61.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/7/8 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.12.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.11.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.124.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 104/105/112
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.101.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.25.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 100/103/104
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.124.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 100/104/112
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.12.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.102.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 100/104/112
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.38.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/113/116
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.103.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/118/128
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.34.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/113/116
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.46.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/8 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.124.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/55/64 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.34.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/52/56 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.104.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/52/52 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.25.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 100/104/112
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.105.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/112/116
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/116/116
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.46.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.61.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.106.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.25.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 100/104/112
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.107.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/116/120
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.38.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 116/116/116
ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/90/92 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/89/92 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.110.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/91/92 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.46.20, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 28/29/32 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/52/52 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/52/52 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.120.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/52/52 ms
R1a(tcl)#
R1a(tcl)#
R1a(tcl)#tclquit
R1a#



This archive was generated by hypermail 2.1.4 : Fri Dec 12 2003 - 12:29:13 GMT-3