Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

EEM and IP SLA

Hi

switch1 (4506, IOS 12.2(53)SG1)

switch1 has default gateway 1.1.1.1 (telco), if 1.1.1.1 is not reachable by PING, then switch1 need remove the default gateway and install a new default gateway of 2.2.2.2, if ping is working, then switch1 need remove 2.2.2.2 and add 1.1.1.1 as default gateway

is this doable with EEM and IP SLA?

thanks

3 REPLIES
Cisco Employee

Re: EEM and IP SLA

Yes, this is doable provided 1.1.1.1 is not reachable when 2.2.2.2 is the default gateway.  If that is the case, then post the output of "show event manager detector all".

New Member

Re: EEM and IP SLA

Thanks for your reply, I am not new to IOS, but new to EEM, if you could, please help to provide a small script for the case

No.  Name                Version   Node        Type   
1    appl                01.00     node1/0     RP     
2    syslog              01.00     node1/0     RP     
3    rf                  01.00     node1/0     RP     
4    energywise          01.00     node1/0     RP     
5    cli                 01.00     node1/0     RP     
6    config              01.00     node1/0     RP     
7    counter             01.00     node1/0     RP     
8    env                 01.00     node1/0     RP     
9    gold                01.00     node1/0     RP     
10   interface           01.00     node1/0     RP     
11   ioswdsysmon         01.00     node1/0     RP     
12   none                01.00     node1/0     RP     
13   oir                 01.00     node1/0     RP     
14   snmp                01.00     node1/0     RP     
15   snmp-notification   01.00     node1/0     RP     
16   test                01.00     node1/0     RP     
17   timer               01.00     node1/0     RP     
18   rpc                 01.00     node1/0     RP   

Embedded Event Manager Version 2.40
Component Versions:
eem: (v240_throttle)2.21.112
eem-gold: (v240_throttle)1.2.37
eem-call-home: (v240_throttle)2.0.1
Event Detectors:
Name                Version   Node        Type   
appl                01.00     node1/0     RP     
syslog              01.00     node1/0     RP     
rf                  01.00     node1/0     RP     
energywise          01.00     node1/0     RP     
cli                 01.00     node1/0     RP     
config              01.00     node1/0     RP     
counter             01.00     node1/0     RP     
env                 01.00     node1/0     RP     
gold                01.00     node1/0     RP     
interface           01.00     node1/0     RP     
ioswdsysmon         01.00     node1/0     RP     
none                01.00     node1/0     RP     
oir                 01.00     node1/0     RP     
snmp                01.00     node1/0     RP     
snmp-notification   01.00     node1/0     RP     
test                01.00     node1/0     RP     
timer               01.00     node1/0     RP     
rpc                 01.00     node1/0     RP

Cisco Employee

Re: EEM and IP SLA

You do not have the track ED (which is what I thought would be the case).  However, you should be able to use object tracking combined with syslog to get what you need.  Make sure your IP SLA collector is being tracked with enhanced object tracking.  For example:

track 1 ip sla 1 reachability

Then, you can use these EEM applets to accomplish what you need:

event manager applet track-down

event syslog pattern "TRACKING-5-STATE: NUM .*Up->Down"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 1.1.1.1"

action 4.0 cli command "ip route 0.0.0.0 0.0.0.0 2.2.2.2"

action 5.0 cli command "end"

!

event manager applet track-up

event syslog pattern "TRACKING-5-STATE: NUM .*Down->Up"

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 2.2.2.2"

action 4.0 cli command "ip route 0.0.0.0 0.0.0.0 1.1.1.1"

action 5.0 cli command "end"

Here, NUM refers to the track number (e.g. that would be 1 in my example above).

601
Views
0
Helpful
3
Replies
CreatePlease to create content