In this recipe, we'll be building upon the code that we developed in the previous recipe in order to deal with a situation where we have a flapping interface causing problems in the network.
Often, when an interface goes down, several computational efforts get underway to recalculate alternate routing options, whether the interface is an internal or external link. When an interface flaps, that is, goes up and down repeatedly, this route recalculation burden can be excessive and can cause further complications and threats to network stability.
We'll introduce some automation that can take an action that is similar to what a human would do when faced with the same situation. In this case, we'll catch the situation where we've seen the interface flap three times in the space of 60 seconds, and we'll disable it, recording...