06-19-2012 11:17 AM
Hi,
Does anybody know how I can copy the IP address from an output from " ping www.cisco.com" into a variable?
"Sending 5, 100-byte ICMP Echos to 95.100.32.170, timeout is 2 seconds"
Thanks
Marc
06-19-2012 05:46 PM
If you mean using EEM, you cam do that using something like:
set output [cli_run [list "enable" "ping www.cisco.com"]]if { [regexp {Echos to ([\d\.]+)} $output -> ip] } { puts "Address is $ip"}
set output [cli_run [list "enable" "ping www.cisco.com"]]
if { [regexp {Echos to ([\d\.]+)} $output -> ip] } {
puts "Address is $ip"
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide
Log in to Community