12-08-2022 01:42 AM
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-08-2022 01:58 AM - edited 12-08-2022 01:59 AM
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
12-08-2022 02:01 AM
Hello,
the script looks good. Can you post the output of:
debug event manager action cli
?
12-08-2022 02:04 AM
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.
12-08-2022 03:06 AM
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
!
12-08-2022 03:16 AM
Can you try - and let me know.
clear ip bgp * all
12-08-2022 03:10 AM - edited 12-08-2022 03:12 AM
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.
12-08-2022 03:17 AM
Thank you so much
12-08-2022 04:36 AM
and You are so so welcome
12-08-2022 02:42 PM
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.
12-09-2022 01:05 AM
Hello,
did you get a chance to capture the output of:
debug event manager action cli
12-09-2022 01:12 AM
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.
12-09-2022 01:19 AM
Hello,
you can easily do this on a live router:
debug event manager action cli
event manager run BGP-RESET
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