ping script - the ultimate solution?

From: Robert Slaski (Robert.Slaski@atm.com.pl)
Date: Thu Dec 05 2002 - 23:08:39 GMT-3


Ok,
Everybody likes ping scripts very much as they allow faster connectivity
checking. But sometimes (especially in The Lab) you work with terminal
program you have never worked before or scripting configuration of
terminal application is very limited or brain damaged. So I had thought:
why not to use the cisco router capabilities instead of terminal
application. After just an hour of digging in IOS I think found the
solution.

Copy-paste the sequence below to your router (replace ip addresses with
yours):

tclsh
foreach pl {
10.14.1.1
10.12.1.1
10.44.3.3
10.11.1.1
} {ping $pl}

Here's the output:

R8-rsl-R5#tclsh
R8-rsl-R5(tcl)#foreach pl {
+>10.14.1.1
+>10.12.1.1
+>10.44.3.3
+>10.11.1.1
+>} {ping $pl}

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.14.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/18/20 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.12.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/20/20 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.44.3.3, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.11.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/20/20 ms
R8-rsl-R5(tcl)#^Z
R8-rsl-R5#

Tested on 2600 and 7200 platform with 12.1(5)T12 and 12.2(6c).
Doesn't work on 3550s :-( (no TCL shell)

Could anybody check this with plain 12.1 IOS train?

robert,

-- 
.


This archive was generated by hypermail 2.1.4 : Fri Jan 17 2003 - 17:21:39 GMT-3