04-18-2013 11:26 AM
I'd like to do a hop-by-hop analysis by running a traceroute script that runs on an interval (say every 5-15 minutes) and puts output to a file.
The goal is to let the script run for a day, and see what kind of hop changes might occur over time, and also monitor for any latency increase or packetloss at certain times of day (peak hours).
If I used an EEM script to do a basic traceroute from one endpoint of the network to a server in the core (for instance), this could show how a client's path may be impacted during peak hours.
I'd want the output stored in a file on the router's flash disk, and then I'd have to find some way to parse and analyze the output later (not sure how I'd do that, perhaps with excel or another diff-like program).
04-18-2013 11:30 AM
I forgot to mention, the script would in this case be run from a CMTS router (near the edge/access), to a server which may be anywhere from 6-12 hops away in the network.
04-18-2013 01:27 PM
There's no questiom here. Are you saying you want someone to write this policy, or are you writing it and running into specific problems?
04-18-2013 01:50 PM
Yes - I meant to ask for a sample/example config for this, as I was surprised to not find one easily on Google
The endpoint would be a static IP address, so the script would not need to be dynamic except for setting a string of the destination IP to traceroute to.
07-01-2013 02:50 PM
Something like this should work for you. In config mode, specify three EEM environment variables:
event manager environment traceroute_timer 600
event manager environment traceroute_target 10.1.1.1
event manager environment traceroute_file flash:/traceroute.txt
Then register this EEM Tcl policy:
::cisco::eem::event_register_timer watchdog time $traceroute_timer namespace import ::cisco::eem::* namespace import ::cisco::lib::* array set arr_einfo [event_reqinfo] if [catch {cli_open} result] { error $result $errorInfo } else { array set cli1 $result } if [catch {cli_exec $cli1(fd) "enable"} _cli_result] { error $_cli_result $errorInfo } if [catch {cli_exec $cli1(fd) "traceroute $traceroute_target"} _cli_result] { error $_cli_result $errorInfo }
set fd [open $traceroute_file a]
puts $fd [clock format [clock seconds]]
puts $fd $_cli_result
close $fd
# Close open cli before exit. catch {cli_close $cli1(fd) $cli1(tty_id)} result
07-01-2013 02:59 AM
jsuddart wrote:
I'd like to do a hop-by-hop analysis by running a traceroute script that runs on an interval (say every 5-15 minutes) and puts output to a file.
The goal is to let the script run for a day, and see what kind of hop changes might occur over time, and also monitor for any latency increase or packetloss at certain times of day (peak hours).
If I used an EEM script to do a basic traceroute from one endpoint of the network to a server in the core (for instance), this could show how a client's path may be impacted during peak hours.
I'd want the output stored in a file on the router's flash disk, and then I'd have to find some way to parse and analyze the output later (not sure how I'd do that, perhaps with excel or another diff-like program).
Or send the output to a syslog server/remote box.
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