Here's a ping script I wrote for lab practice. You could easily modify it
for your purpose.
proc pi {} {
foreach i {
192.168.1.1
192.168.1.2
192.168.1.3
} { set status [ catch { exec "ping $i" } msg ]
if {! [regexp "\(5/5\)" $msg]} {
puts $msg
}
}
}
Eric Lauriault
On Thu, Nov 11, 2010 at 1:30 AM, Marcin Zgola <MZgola_at_netrixllc.com> wrote:
> i have a PE router, that i want to develop TCL script that will check
> connectivity to all of the customers.
>
> I am confused with the script. HEre is list of ip addresses i want to ping
> sourcing from each VRF< and results either PASSED or FAILED.
>
> can some one help me?
>
> set cust2 {
> 10.8.2.1
> 10.8.2.2
> 10.8.2.7
> 10.8.0.45
> 10.3.1.1
> 10.3.2.1
> 10.3.0.26
> 10.3.0.3
> 172.16.64.1
> 172.16.68.1
> }
> set cust1 {
> 167.10.10.5
> 10.10.0.1
> 10.10.0.5
> }
> foreach address {
>
> } {
> if { [regexp "(!!!!!!!!!)" [exec "ping vrf CUST1 $address rep 10" ]] } {
> puts "$address ****** PASSED *******"
> } else { puts "$address ****** FAILED ******" }
> }
> if { [regexp "(!!!!!!!!!)" [exec "ping vrf C-GRATE $addressgrate rep 10" ]]
> } {
> puts "$address ****** PASSED *******"
> } else { puts "$address ****** FAILED ******" }
>
> Marcin Zgola
> Internetwork Lead
> CCIE #18676
> Netrix, LLC
> http://www.netrixllc.com
> Ph. 847-964-5300
> Fax.: 847-964-5350
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
Blogs and organic groups at http://www.ccie.net
Received on Thu Nov 11 2010 - 09:29:00 ART
This archive was generated by hypermail 2.2.0 : Sun Dec 05 2010 - 22:14:56 ART