cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5214
Views
0
Helpful
9
Replies

EEM script to report routing table change

roger perkin
Level 2
Level 2

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

9 Replies 9

mousmani
Level 1
Level 1


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

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

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

mousmani
Level 1
Level 1


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

Antonio Knox
Level 7
Level 7

Are you running any routing protocol?  If so, which one(s)?

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

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.

I know that this is an old post, but could you provide an updated link to the EEM script you developed for reporting routing table changes?

Thanks.

Ed
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card