RE: Tclsh question..

From: Mike Ollington (Mike.Ollington@uk.didata.com)
Date: Thu Jan 12 2006 - 05:14:45 GMT-3


I didn't like `puts' because it holds the output of the ping until ping is
completed - I preferred to see the dots appearing before they whizzed off the
screen so I could evaluate whether the timeouts were legitmate e.g. local
frame interface.

I ammended the script so I only had to paste it on one router and then use rsh
to test all the others.

tclsh
proc ping_all {ip} {
foreach {igp} {
1.1.1.1
2.2.2.2
3.3.3.3 } {$ip $igp repeat 3 timeout 1}}

router(tcl)#ping_all ping - for the local router
router(tcl)#ping_all "rsh 150.1.2.2 ping" - for a remote router.

-----Original Message-----
From: nobody@groupstudy.com on behalf of Wang Dehong-DWANG1
Sent: Wed 1/11/2006 11:54 PM
To: Bajo
Cc: Cisco certification
Subject: RE: Tclsh question..

thanks. it works with puts..

________________________________

From: Bajo [mailto:bajoalex@gmail.com]
Sent: Wednesday, January 11, 2006 5:48 PM
To: Wang Dehong-DWANG1
Cc: Cisco certification
Subject: Re: Tclsh question..

Try with "puts":

tclsh
!
foreach address {
150.1.1.1
150.1.2.2
150.1.3.3
150.1.4.4
150.1.5.5
150.1.6.6
150.1.7.7
150.1.8.8

204.12.1.254
192.10.1.254
54.1.7.6
54.1.7.254

} {puts [exec "ping $address"]}

tclquit

On 1/11/06, Wang Dehong-DWANG1 <Dehong.Wang@motorola.com> wrote:

        Any idea why this script does not work with 12.3 release? Ping
command
        just sit there and does nothing. It works with other release.
Thanks.

        - Dehong

        tclsh
        foreach ip {
        136.1.136.1
        150.1.1.1
        136.1.245.2
        } {ping $ip}

        Rack1R5#tclsh
        Rack1R5(tcl)#foreach ip {
        +> 136.1.136.1
        +> 150.1.1.1
        +> 136.1.245.2
        +>} {ping $ip}

        Rack1R5(tcl)#tclq

        Rack1R5#dir flash:
        Directory of flash:/

           1 -rw- 25730484 Dec 27 2005 20:45:18 +00:00
        c2600-jsx-mz.123-14.T3.bin

        33030140 bytes total (7299592 bytes free)

        Rack1R1#tclsh
        Rack1R1(tcl)#foreach ip {
        +> 136.1.136.1
        +> 150.1.1.1
        +> 136.1.245.2
        +>} {ping $ip}

        Type escape sequence to abort.
        Sending 5, 100-byte ICMP Echos to 136.1.136.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 150.1.1.1, timeout is 2
seconds:
        !!!!!
        Success rate is 100 percent (5/5), round-trip min/avg/max =
1/1/4 ms
        Type escape sequence to abort.
        Sending 5, 100-byte ICMP Echos to 136.1.245.2, timeout is 2
seconds:
        !!!!!
        Success rate is 100 percent (5/5), round-trip min/avg/max =
120/137/204
        ms

        Rack1R1#dir flash:
        Directory of flash:/

           1 -rw- 18309296 Mar 02 1993 11:10:19
        c2600-js-mz.122-15.T16.bin

        33030144 bytes total (14720784 bytes free)
        Rack1R1#exit

        [Connection to 150.1.1.1 closed by foreign host]



This archive was generated by hypermail 2.1.4 : Wed Feb 01 2006 - 07:45:48 GMT-3