EEM script to report routing table change

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2011 06:17 AM - edited 03-07-2019 03:53 AM
I have setup an EEM script to report any config changes on our WAN switch and email them to me,
Script below:
event manager applet mail_cfg_chg
event syslog pattern ".*%SYS-5-CONFIG_I.*"
action 1.0 info type routername
action 1.1 cli command "enable"
action 1.2 cli command "show archive log config all"
action 1.3 mail server "10.*.*.*" to "roger@******" from "****@**.com" subject "Config change on ****" body "$_cli_result"
action 1.4 cli command "clear archive log config force"
!
This works beautifully and any config change is emailed to me within
What I would really like is for this script to report any changes in the routing table?
Anybody know how I would achieve this?
Thanks
Roger
- Labels:
-
Other Switching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2011 06:54 AM
you need to track the route and use it as event in the EEM.
track 1 ip route x.x.x.x x.x.x.x reachability delay down 60 up 10
event manager applet ROUTE-CHANGE
event track 1 state down
action 1.1 syslog msg "Route-change"
something like this will help
regards,
aslam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2011 07:00 AM
You could also track the next-hops. reachablity
basically these are the things which changes whenever there is a routing table change.
these can be used as triggers for event or a routing protocol change syslog message for ospf or BGP session going down.
regards,
aslam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2011 07:01 AM
You could also track the next-hops. reachablity
basically these are the things which changes whenever there is a routing table change.
these can be used as triggers for event,
or a routing protocol change syslog message for ospf or BGP session going down.
regards,
aslam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2011 06:54 AM
you need to track the route and use it as event in the EEM.
track 1 ip route x.x.x.x x.x.x.x reachability delay down 60 up 10
event manager applet ROUTE-CHANGE
event track 1 state down
action 1.1 syslog msg "Route-change"
something like this will help
regards,
aslam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2011 06:54 AM
Are you running any routing protocol? If so, which one(s)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2011 04:14 PM
Hi running OSPF,
I normally have debug ip routing running on our wan switch up on my screen just to see what is going on.
it would be nice to get this kind of alerting via eem
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2011 09:57 AM
Heh. This is a very common request, and one we are adding to a lot of our presentation material for shows like CiscoLive. I just answered this same question on another thread. Check out:
https://supportforums.cisco.com/thread/2122275?tstart=0
If you want to focus the applet's attention on OSPF routes only, add a "protocol ospf" to the event routing line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2020 04:52 AM
Thanks.
Ed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2021 01:11 AM
Here's the updated link I found:
