cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3932
Views
1
Helpful
1
Replies

TCL: Save Ping Output to a File

terrygwazdosky
Level 1
Level 1

I found a simple script to ping a list of IPs, but how do I output the results to a file in flash?

This is what I have so far:

foreach address {
10.226.126.30
224.0.0.5} { ping $address repeat 5 source g1/0/0
}

Thanks.

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

set fd [open "flash:ping.txt" w]

foreach address {10.226.126.30 224.0.0.5} {

    set output [exec "ping $address repeat 5 source g1/0/0"]

    puts $fd $output

}

close $fd

View solution in original post

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

set fd [open "flash:ping.txt" w]

foreach address {10.226.126.30 224.0.0.5} {

    set output [exec "ping $address repeat 5 source g1/0/0"]

    puts $fd $output

}

close $fd