03-26-2015 01:24 AM
Need to monitor primary & Sec links, select the best based on the following criteria
1. Packet drops
2. Link flapping
3. Input Errors
4. Output drops
04-02-2015 09:59 AM
Given the number of criteria, you could have a policy that wakes up periodically, checks the output of "show interface" for the two interfaces in question, extracts the fields, reliability, drops, and errors; and then does whatever it takes to prefer one interface other the other.
One issue I see with this is that if traffic is diverted away from one interface, errors and drops will go to zero. You could still measure reliability, though. Another potential problem is ping-ponging between the two interfaces every time your policy runs. So you'd need to think about thresholds to this.
Without all of the details, here is some pseudo-applet code that you could use as a model:
event manager environment primary_intf GigabitEthernet0/1
cli command "enable"
cli command "show interface $primary | inc reliability|output drops|input errors"
regexp "reliability ([0-9]+)/255.*Total output drops: ([0-9]+)" $_cli_result match rel drops
regexp "([0-9]+) input errors" $_cli_result match ierrs
if $rel lt $rel_threshold goto FAILOVER_LABEL
if $drops gt $drop_threshold goto FAILOVER_LABEL
if $ierrs gt $ierr_threshold goto FAILOVER_LABEL
! FAILOVER_LABEL would start here
cli command "config t"
! Do failover CLI
cli command "event manager environment primary_intf NEW_ACTIVE_INTF"
cli command "end"
cli command "clear counters NEW_ACTIVE_INTF"
04-23-2015 11:07 PM
Thanks Joseph. will try this and update..
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