Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

Bronze

EEM Script to identify and email BGP Flap

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
Bronze

Any help would be appreciated

Any help would be appreciated.

Bronze

Any help would be appreciated

Any help would be appreciated.

New Member

Good Afternoon...

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

Cisco Employee

To do what you want, you

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.

84
Views
0
Helpful
4
Replies