proc ping1 {IP} {
set PING [ exec "ping vrf CUST1 $IP repeat 10" ]
set PING [ regexp -inline -all {[\.!]{3}} $PING ]
if { [ string first "!" $PING ] == -1 } {
puts "[format "%-40s %s" "ping $IP" "****** FAILED *******" ]"
} else { puts "[format "%-40s %s" "ping $IP" "****** PASSED *******" ]" }
}
proc ping2 {IP} {
set PING [ exec "ping vrf C-GRATE $IP repeat 10" ]
set PING [ regexp -inline -all {[\.!]{3}} $PING ]
if { [ string first "!" $PING ] == -1 } {
puts "[format "%-40s %s" "ping $IP" "****** FAILED *******" ]"
} else { puts "[format "%-40s %s" "ping $IP" "****** PASSED *******" ]" }
}
foreach address {
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
} { ping2 $address }
foreach address {
167.10.10.5
10.10.0.1
10.10.0.5
} { ping1 $address }
Regards,
Tyson Scott - CCIE #13513 R&S, Security, and SP
Managing Partner / Sr. Instructor - IPexpert, Inc.
Mailto: tscott_at_ipexpert.com
-----Original Message-----
From: nobody_at_groupstudy.com [mailto:nobody_at_groupstudy.com] On Behalf Of
Marcin Zgola
Sent: Thursday, November 11, 2010 1:31 AM
To: Cisco certification
Subject: TCL Script help
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
Received on Thu Nov 11 2010 - 18:11:07 ART
This archive was generated by hypermail 2.2.0 : Sun Dec 05 2010 - 22:14:56 ART