cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1297
Views
10
Helpful
12
Replies

EMM script not working

Hello All, Need help.

My below script is not working. it doesn't clear the BGP but log says "BGP peer reset complete". Please let me know if I am missing something

 

event manager session cli username "xxxx"
event manager applet BGP-RESET
description Clear BGP peers when MPLS circuit restore
event syslog pattern "%TRACK-6-STATE: 1 ip sla 1 reachability Down -> Up"
action 1.0 cli command "enable"
action 2.0 cli command "clear ip bgp *"
action 3.0 syslog msg "BGP peer reset complete"
!

 

 

 

12 Replies 12

clear ip bgp << only add AS to clear ip bgp command, this need for thi command to work. 

clear ip bgp <AS>

AS is the remote-as of neighbor you IP SLA down->up

 

Hello,

the script looks good. Can you post the output of:

debug event manager action cli

?

balaji.bandi
Hall of Fame
Hall of Fame

how is your BGP config, do you have any ipv4 addres family configured. ?

what happends when you clear Manually is that clears BGP ?

you looking to clear all BGP peers ?

clear ip bgp * all

Note : i would suggesdt to clear manually see that command works before you put them in EEM Script.

also run debug see what is error you getting is the command excuted.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hello, Thanks for your reply.. Yes 

This is how it is configured

router bgp xxxx
bgp router-id x.x.x.x
bgp log-neighbor-changes
neighbor B2B peer-group
neighbor PRIMARY peer-group
neighbor SECONDARY peer-group
neighbor TERTIARY peer-group
neighbor 1.1.1.1 remote-as xxxx
neighbor 1.1.1.1 peer-group B2B
neighbor 2.2.2.2 remote-as xxxxx
neighbor 2.2.2.2 peer-group SECONDARY
neighbor 3.3.3.3 remote-as xxxxxx
neighbor 3.3.3.3 peer-group PRIMARY
!
address-family ipv4
network x.x.x.x mask x.x.x.x
neighbor B2B send-community
neighbor B2B next-hop-self
neighbor B2B soft-reconfiguration inbound
neighbor B2B route-map IBGP-IN in
neighbor B2B route-map IBGP-OUT out
neighbor PRIMARY send-community
neighbor PRIMARY soft-reconfiguration inbound
neighbor PRIMARY route-map DMVPN-PRIMARY-IN in
neighbor PRIMARY route-map DMVPN-PRIMARY-OUT out
neighbor SECONDARY send-community
neighbor SECONDARY soft-reconfiguration inbound
neighbor SECONDARY route-map DMVPN-SECONDARY-IN in
neighbor SECONDARY route-map DMVPN-SECONDARY-OUT out
neighbor TERTIARY send-community
neighbor TERTIARY soft-reconfiguration inbound
neighbor TERTIARY route-map DMVPN-TERTIARY-IN in
neighbor TERTIARY route-map DMVPN-TERTIARY-OUT out
neighbor 1.1.1.1 activate
neighbor 2.2.2.2 activate
neighbor 3.3.3.3 activate
!

Can you try - and let me know.

clear ip bgp * all

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Screenshot (53).pngScreenshot (54).png

I had time to do small lab, I try your config is not work but 
I change the event from your to 
event track 1 state up 

and you can see the reset work. (without add AS for clear ip bgp ).


for syslog I will more check why it not work and update you tonight. I am out home now.

Thank you so much 

and You are so so welcome 

Screenshot (59).pngScreenshot (60).png

I make double check and use syslog and also it work. 
check my config. 

%TRACK-6-STATE: 1 ip sla 1 reachability Down -> Up <<<<-- 5 not 6 is level of syslog , and it better to copy the log and paste in EEM.

Hello,

did you get a chance to capture the output of:

debug event manager action cli

Hello Georg, This is my live router, cannot do anything. But yes, when I'll get a chance I'll capture debug output and share here.

Hello,

you can easily do this on a live router:

debug event manager action cli

event manager run BGP-RESET