Book now with code EOY2025
itdaddy wrote: » Is the tcl script possible ?
mikej412 wrote: » Grammar, spelling, punctuation... What did you do with the REAL itdaddy?
mkomon wrote: » As for your ping script, maybe this could help:
Router#show ip int brief Interface IP-Address OK? Method Status Prot ocol .................. Loopback1 1.1.1.1 YES manual up up Loopback10 10.0.0.1 YES manual up up Router#tclsh Router(tcl)#proc ping { IP } { +>set PING [ exec "ping $IP repeat 3" ] +>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" "\[ OK \]" ]" +>} +>} Router(tcl)# Router(tcl)#foreach address { +>10.0.0.1 +>192.168.1.1 +>192.168.1.2 +>192.168.1.3 +>192.168.1.4 +>192.168.1.5 +>1.1.1.1 +>} { +>ping $address +>} ping 10.0.0.1 [ OK ] ping 192.168.1.1 [failed] ping 192.168.1.2 [failed] ping 192.168.1.3 [failed] ping 192.168.1.4 [failed] ping 192.168.1.5 [failed] ping 1.1.1.1 [ OK ] Router(tcl)#tclquit Router#
Use code EOY2025 to receive $250 off your 2025 certification boot camp!