cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1821
Views
0
Helpful
3
Replies

Embedded Event manager scripting help

MarekVanco_2
Level 1
Level 1

Hello,

I'm looking into a way to do the following:

If pinging of BGP peer detects packet loss, or circuit flapping, lets say 5 flaps in 60 secs, then I'd like the bgp peering to go into admin down state.

Would be nice if it also recovered on its own when 1hour or X of stability was detected.

Thank you

3 Replies 3

MarekVanco_2
Level 1
Level 1

I found a good doc and think i'll be going with this:

IP SLA 3

   icmp-echo X.X.X.X  source-interface GIGXXXX

IP SLA schedule  3 life forever  start-time now

track 3 ip sla 3  reachability

delay up XX

event manager applet  WAN_DOWN

event track 3 state  down

action 1.0 syslog msg "Packet loss  or Primary WAN cct loss detected"

action 2.0 cli command  "enable"

action 3.0 cli command "config  t"

action 4.0 cli command "router bgp XXXXX"

action 5.0 cli command "neighbor X.X.X.X shut"

action 6.0 cli command  "end"

action 7.0 syslog msg "BGP neighbor  placed in Admin Down because of packet loss to  Peer"

event managet applet  wan_up

event track 3 state  up

action 1.0 syslog msg "WAN network  restored"

action 2.0 cli command  "enable"

action 3.0 cli command "config  t"

action 4.0 cli command "router bgp XXXXX"

action 5.0 cli command "no neighbor  x.x.x.x shut"

action 6.0 cli command  "end"

action 7.0 syslog msg "BGP neighbor  was brought up due to sustained comm with Peer"

so now I ahve issues trying to get the "delay up" to 10-30 minutes like i'd like... max is 180seconds

You will not be able to use delay up here.  What you can do is have the "up" policy configure a third policy to wait the specified amount of time.  Then modify the down policy to unconfigure that third policy.  For example:

event manager applet WAN_DOWN

  event track 3 state down

  action 1.0 syslog msg "Packet loss  or Primary WAN cct loss detected"

  action 2.0 cli command  "enable"

  action 3.0 cli command "config  t"

  action 4.0 cli command "router bgp XXXXX"

  action 5.0 cli command "neighbor X.X.X.X shut"

  action 5.1 cli command "no event manager applet WAN_HOLD_DOWN_UP"

  action 6.0 cli command  "end"

  action 7.0 syslog msg "BGP neighbor placed in Admin Down because of packet loss to  Peer"

!

event manager environment q "

!

event manager applet WAN_UP

event track 3 state up

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "event manager applet WAN_HOLD_DOWN_UP"

action 3.1 cli command "event timer countdown time 1800"

action 3.2 cli command "action 1.0 syslog msg $q WAN network  restored$q"

action 3.3 cli command "action 2.0 cli command $q enable$q"

action 3.4 cli command "action 3.0 cli command $q config  t$q"

action 3.5 cli command "action 4.0 cli command $q router bgp XXXXX $q"

action 3.6 cli command "action 5.0 cli command $q no neighbor  x.x.x.x shut$q"

action 3.7 cli command "action 6.0 cli command  $q end$q"

action 3.8 cli command "action 7.0 syslog msg $q BGP neighbor was brought up due to sustained comm with Peer$q"

action 4.0 cli command "end"