cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1168
Views
0
Helpful
1
Replies

EEM script on Cisco routers to fetch BGP Uptime

HSLNWADMIN
Level 1
Level 1

How we can implement EEM script on Cisco routers to fetch BGP Uptime Details.

Example: If the router goes unreachable to us due to link down issue or Router reboot. After the device comes up then we should know what was the exact issue if BGP was down (Interface was up) or interface went down etc.

Please help us to know what would be EEM script to implement it.

1 Reply 1

balaji.bandi
Hall of Fame
Hall of Fame

here is the startup guide from csico for EEM :

 

https://community.cisco.com/t5/networking-documents/cisco-eem-basic-overview-and-sample-configurations/ta-p/3148479

 

here is example of BGP EEM scrip from my notes. (this is for reference only - tweak as per requirement)

 

!!BGP down
event manager applet BGP_DOWN_2
event syslog pattern "neighbor IPaddress2 Down"
action 02 if $BGP eq 0
action 50 syslog msg "Setting variable equals 20 - 1 neighbor down"
action 51 set $BGP 20
action 55 end
action 60 if $BGP ne 0
action 60 syslog msg "Shuting down interfaces for neighbor - 2 links down"
action 61 set $BGP 40
action 62 cli command "enable"
action 63 cli command "conf term"
action 65 cli command "interface vlan 30"
action 66 cli command "shutdown"
action 67 cli command "interface vlan 31"
action 68 cli command "shutdown"
action 69 syslog msg "Removed comunications with Router Reflector"
action 70 end

 

 

BB

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

How to Ask The Cisco Community for Help

Review Cisco Networking for a $25 gift card