cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2398
Views
0
Helpful
4
Replies

EEM Script to identify and email BGP Flap

Cisco Freak
Level 4
Level 4

Hi Experts,

I wrote a small EEM script to identify and email when a BGP neighbor goes down.

This is the relevant portion of that script:

event manager applet BGP-FLAP
event syslog pattern " %BGP-5-NBR_RESET:"
action 1.0 syslog msg "BGP-FLAP"
..
..
..
..
action 9.2 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "BGP Flap" body "$_cli_result"

action 9.4 cli command "exit"

This script works perfectly. But the problem is, since the script monitor the syslog pattern " %BGP-5-NBR_RESET:" , when 15 neighbors go down, it will trigger 15 different emails.

Is there any way to customize this script the trigger just one email even if 1 neighbors flapps OR 10 neighbor flaps. Even if 10 neighbor goes down, this script should trigger just one email.

CF

4 Replies 4

Cisco Freak
Level 4
Level 4

Any help would be appreciated.

Any help would be appreciated.

Cisco4Life
Level 1
Level 1

Good Afternoon...

I am interested in seeing your complete EEM script to identify BGP flaps and email them my PAgerDuty service.  Are you able to provide your script?

Thanks

Frank

Joe Clarke
Cisco Employee
Cisco Employee

To do what you want, you could write the flaps to a file on flash (you can do this with applets if you have EEM 4.0).  Then, have another applet that periodically checks this file, and if it has contents, send an email with the contents.  This second policy could be done using a cron or watchdog timer.  For example, if you wanted emails no more frequently than every five minutes, have a watchdog run every 300 seconds.