07-15-2014 09:39 PM
Hi experts,
I have set up a small script to monitor BGP peering and to failover the HSRP based on the syslog etc. What I noticed is that the event gets triggered but it doesn't make the necessary changes. What I want is to change the HSRP priority upon a BGP peering failure. Below is the script. Can someone please help whats missing here. I have this script on a 3800 series router
Cisco IOS Software, 3800 Software (C3845-ADVIPSERVICESK9-M), Version 12.4(25b), RELEASE SOFTWARE (fc1)
System image file is "flash:c3845-advipservicesk9-mz.124-25b.bin"
event manager applet eBGP-DOWN
event syslog pattern "%BGP-5-ADJCHANGE: neighbor 192.168.1.1 Down Peer closed the session"
action 1.0 syslog priority critical msg "EEM reconfiguring router for HSRP priority of 90 as BGP neighbour is down"
action 2.0 cli command "enable"
action 3.0 cli command "config t"
action 4.0 cli command "interface gi0/0"
action 5.0 cli command "standby 1 priority 90"
event manager applet eBGP-UP
event syslog pattern "%BGP-5-ADJCHANGE: neighbor 192.168.1.1 Up"
action 1.0 syslog priority critical msg "EEM reconfiguring router for HSRP priority of 140 as BGP neighbour is up"
action 2.0 cli command "enable"
action 3.0 cli command "config t"
action 4.0 cli command "interface gi0/0"
action 5.0 cli command "standby 1 priority 140"
event manager applet eBGP-MANUAL-DOWN
event syslog pattern "%BGP-5-ADJCHANGE: neighbor 192.168.1.1 Down Admin. shutdown"
action 1.0 syslog priority critical msg "EEM reconfiguring router for HSRP priority of 90 as BGP neighbour is down"
action 2.0 cli command "enable"
action 3.0 cli command "config t"
action 4.0 cli command "interface gi0/0"
action 5.0 cli command "standby 1 priority 90"
!
end
router#sh log | i BGP
Jul 16 07:54:29.978: %BGP-5-ADJCHANGE: neighbor 192.168.1.1 Down Admin. shutdown
Jul 16 07:54:29.978: %HA_EM-2-LOG: eBGP-MANUAL-DOWN: EEM reconfiguring router for HSRP priority of 90 as BGP neighbour is down
Jul 16 10:54:10.988: %BGP-5-ADJCHANGE: neighbor 192.168.1.1 Up
Jul 16 10:54:10.992: %HA_EM-2-LOG: eBGP-UP: EEM reconfiguring router for HSRP priority of 140 as BGP neighbour is up
07-16-2014 07:12 AM
If you are using AAA command authorization, you will also need to configure:
event manager session cli username USER
Where USER is a username authorized to run all of these CLI commands.
07-16-2014 04:13 PM
Thanks a lot Joe. Will try this and get back to you
Regards, Kishore
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