EEM script to minimize Tunnel Flapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2015 03:55 PM
We have two Tunnel interfaces configured on a router Tunnel0 and Tunnel1 running BGP. If Tunnel0 is consistenly bouncing over a set period of time and we received 5 BGP down messages in 180 seconds then shut, however first check the status of Tunnel1 and if down do nothing, but if up perform the shut on Tunnel 0.
I am guessing that during the scripts actions there is a way to show int Tunnel1 and record/set a variable for the interface status that I can then check against before I shut down the problem interface.
- Labels:
-
EEM Scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2015 02:50 PM
This should do what you want.
event manager environment bgpneighbor 192.168.200.2
event manager applet tunnelflap
event syslog occurs 5 pattern "neighbor $bgpneighbor is down" period 180
action 010 cli command "enable"
action 020 cli command "show ip int brief | inc Tunnel1"
action 030 regexp "up up" "$_cli_result"
action 040 if $_regexp_result eq 1
action 050 cli command "conf t"
action 060 cli command "int tunnel0"
action 070 cli command "shutdown"
action 080 end
