cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2751
Views
0
Helpful
3
Replies

TcL extended ping script?

juan_6_810
Level 1
Level 1

Hi,

I have been looking online to try and find a way to automate extended pings with the record option, but have only found some that are for regular pings.

This is one of the ones that I found:

foreach address {
x.x.x.x
x.x.x.x
x.x.x.x} { ping $address repeat 10 size 1500
}

My question is, would simply adding "record" to the script work?

Thanks in advance,

Juan.

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

No.  The record option cannot be specified directly on the command line.  You can use EEM Tcl to do what you want.  The attached script will work.  Edit it to replace the "x.x.x.x" with your IPs.  Copy this script to a directory on flash (flash:/policies), then configure:

event manager directory user policy flash:/policies

event manager policy ping_record.tcl

Run the script with the EXEC command:

event manager run ping_record.tcl

View solution in original post

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

No.  The record option cannot be specified directly on the command line.  You can use EEM Tcl to do what you want.  The attached script will work.  Edit it to replace the "x.x.x.x" with your IPs.  Copy this script to a directory on flash (flash:/policies), then configure:

event manager directory user policy flash:/policies

event manager policy ping_record.tcl

Run the script with the EXEC command:

event manager run ping_record.tcl

Thanks.

if { [catch {cli_write $cliarr(fd) "ping ip"} result] } {
error $result $errorInfo

 

How do I modify this line if my original command is ping 10.172.1.1 so 10.200.1.1?

 

"ping $ip so 10.200.1.1"?

 

 

Thanks,

Jack

jacknew2005@gmail.com