cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3062
Views
0
Helpful
2
Replies

EEM: "event routing network" vrf aware?

rokraus
Level 1
Level 1

Hello everybody!

I've 2 questions related to above topic:

1.) how do I get the vrf information for a route beeing changed.

2.) how do I track all routes in the routing table. including default-route

The following command: event routing network 0.0.0.0/0 ge 1;  does not match the default-route.

Complete applet:

event manager applet route-table-monitor

event routing network 0.0.0.0/0 ge 1

action 1.0 syslog msg "Route changed: Type: $_routing_type, Network: $_routing_network, Mask/Prefix: $_routing_mask, Protocol: $_routing_protocol, GW: $_routing_lastgateway, Intf: $_routing_lastinterface"

!

As a workaround for the above: (This monitors all routes inclouding default-route; however there is still no vrf info)

event manager applet route-table-monitor

event tag e1 routing network 0.0.0.0/0

event tag e2 routing network 0.0.0.0/0 ge 1

trigger occurs 1

  correlate event e1 or event e2

action 1.0 syslog msg "Route changed: Type: $_routing_type, Network:  $_routing_network, Mask/Prefix: $_routing_mask, Protocol:  $_routing_protocol, GW: $_routing_lastgateway, Intf:  $_routing_lastinterface"

Best regards

Robert

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

Your workaround for the default route is correct.  You have to watch the 0.0.0.0 route, and you can't have the ge value be 0 :-(.

For VRF, this was added in EEM 4.0.  There is now a "vrf" keyword for the routing ED.

Hi Joseph!

Thx for your reply. I found the same fot the VRF thing and changed the applet to:

event manager applet route-table-monitor

event tag e1 routing network 0.0.0.0/0 ge 1 vrf name mandant1 maxrun 2

event tag e2 routing network 0.0.0.0/0 ge 1 vrf name mandant1

trigger occurs 1

  correlate event e1 or event e2

action 1.0 syslog msg "Route changed: Type: $_routing_type, VRF: $_routing_vrf_name, $_routing_protocol, $_routing_network/$_routing_mask [$_routing_distance/$_routing_metric] via $_routing_lastgateway, $_routing_lastinterface"

!

Unfrotunately, almost all of our devices do not support eem 4.0

Once again thank's a lot.

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: