Showing posts with label Cisco TCL script. Show all posts
Showing posts with label Cisco TCL script. Show all posts

Wednesday, January 25, 2012

Cisco TCL script


1. create the script onto a Cisco router
2. run the script from that router
3. collect the result from that router

877w#tclsh
877w(tcl)#

puts [open flash:pinggoogle.tcl w+] {
set pingresult [open flash:pingresult w+]
set output [exec ping 8.8.8.8 r 1000]
puts $pingresult [string trim $output]
close $pingresult
}

877w(tcl)#tclquit

877w#tclsh pinggoogle.tcl