Just found out about tclsh
I'm surprised I haven't heard about tcl earlier. Seems like it could be useful when you want to ping a lot of stuff.
I've been playing around with it and wrote this script
I couldn't figure out how to print the 3rd line in a string, so I had to calculate how many characters it is to the start and end of the 3rd line
here's the output from the script
R1#tclsh pings
*17:15:50.420 UTC Thu Aug 20 2015 --- Start pinging ---
!!! 10.7.52.1 OK
!!! 10.7.53.1 OK
... 10.10.10.1 ***unreachable***
... 10.100.10.22 ***unreachable***
!!! 10.7.42.1 OK
!!! 10.7.42.5 OK
*17:16:02.480 UTC Thu Aug 20 2015 -- Pings stopped ---
R1#
I've been playing around with it and wrote this script
puts [open "flash:pings" w+] { puts "" show clock puts " --- Start pinging ---" puts "" foreach add { 10.7.52.1 10.7.53.1 10.10.10.1 10.100.10.22 10.7.42.1 10.7.42.5 } { set output [exec "ping $add repeat 3"] set addlength [string length $add] set x [expr "$addlength" + 93] set y [expr "$addlength" + 95] if {[regexp "!" $output]} {puts "[string range $output $x $y] $add OK" } else {puts "[string range $output $x $y] $add ***unreachable***"}} show clock puts " -- Pings stopped ---" }
I couldn't figure out how to print the 3rd line in a string, so I had to calculate how many characters it is to the start and end of the 3rd line
here's the output from the script
R1#tclsh pings
*17:15:50.420 UTC Thu Aug 20 2015 --- Start pinging ---
!!! 10.7.52.1 OK
!!! 10.7.53.1 OK
... 10.10.10.1 ***unreachable***
... 10.100.10.22 ***unreachable***
!!! 10.7.42.1 OK
!!! 10.7.42.5 OK
*17:16:02.480 UTC Thu Aug 20 2015 -- Pings stopped ---
R1#
A.A.S. in Networking Technologies
A+, Network+, CCNA
A+, Network+, CCNA
Comments
-
Hondabuff Member Posts: 667 ■■■□□□□□□□Or you can just use a program like PingInfoView. Tclsh is a CCIE topic and I still have not found a practical way to use it. Im sure someone has tinkered with it before.
PingInfoView - Ping to multiple host names/IP addresses“The problem with quotes on the Internet is that you can’t always be sure of their authenticity.” ~Abraham Lincoln -
--chris-- Member Posts: 1,518 ■■■■■□□□□□Or you can just use a program like PingInfoView. Tclsh is a CCIE topic and I still have not found a practical way to use it. Im sure someone has tinkered with it before.
PingInfoView - Ping to multiple host names/IP addresses
This looks a lot like multiping
https://www.multiping.com/
Tclsh looks fun. Does anyone have a use case for it? -
Lenniusce Member Posts: 114 ■■■■□□□□□□Or you can just use a program like PingInfoView. Tclsh is a CCIE topic and I still have not found a practical way to use it. Im sure someone has tinkered with it before.
PingInfoView - Ping to multiple host names/IP addresses
Probably more like NP. It was in my ROUTE class.In Progress: CCNA:DEVNET or CISSP Done: PMP | A+ | N+ | S+ | L+ | P+ | MCSA 2016 | CCNA | CCNA:S(exp) | LPIC1(exp) | MBA IT Management | MS Information Systems