cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1232
Views
0
Helpful
1
Replies

EEM trigger when routing table gets adjusted

WildCard81
Level 1
Level 1

Hi there,

 

I recently discovered the EEM and found out how fun and powerfull this can be!

But I came across a problem...

I have an rather simple applet, with a variable problem, and I can't get it to work.

What I would like to become is that when OSPF gets "disconnected" that a static route will be created. and when ospf gets back that the static route gets removed.

I got it running with a manually written static route in the applet, but I cn't get it to work with a variable...

I want it that the route thats dissapears in ospf gets stored in a variable and will be reusable to create the static route.

here are the two applets...

#####

event manager applet INSERT_static_route_when_OSPF_fails
 event routing network 0.0.0.0/0 type remove protocol OSPF ge 1
 action 0.5 cli command "enable"
 action 1.0 cli command "conf t"
 action 2.0 cli command "ip route $routing_network $network_mask 10.0.0.1 130"
 action 3.0 cli command "end"
 action 4.0 cli command "wr mem"

event manager applet REMOVE_static_route_when_OSPF_Loading_Done
 event routing network 0.0.0.0/0 type add protocol OSPF ge 1
 action 0.5 cli command "enable"
 action 1.0 cli command "conf t"
 action 2.0 cli command "no ip route $routing_network $network_mask  10.0.0.1 130"
 action 3.0 cli command "end"
 action 4.0 cli command "wr mem"

any ideas? other solutions, because I'm very stuck here :)

think I'm doing something wrong or impossible...:)

Kind regards

W.
 

 

 

 

 

1 Reply 1

WildCard81
Level 1
Level 1

never mind :) ...syntax/typing error...  NOT $network_mask    but $_routing_mask

duh :)

works like a charm ;)