TCL script to check end to end reachibility

August 10, 2008 at 1:15 pm | Posted in Blogroll, IOS services | Leave a comment

TCL is a great tool to check full reachablility. Below is a simple script to check end to end connectivity

tclsh
foreach i {
150.1.1.1
192.10.1.1
141.1.123.1
}  {ping $i}

However, for a large network with a lot of IP to check, the output of this ping script might be hard to see.  An “improved ” version is below, which only show IP address with successful pings, and those unreachible really stand out.

tclsh
proc ping-igp {} {
foreach i {
150.1.1.1
192.10.1.1
141.1.123.1
} {
if { [regexp “!!!”  [exec “ping $i timeout 1” ]]} { puts “$i”} else { puts “$i  failed” }
}
}

To invoke this script, just type ping-igp under the TCL shell prompt. The output is something like:

150.1.1.1
192.10.1.1 — failed
141.1.123.1

Advertisements

Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: