cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4475
Views
0
Helpful
3
Replies

Cisco EEM triggered from IP SLA reaction configuration

l.hansen
Level 1
Level 1

Hi,

I am trying to monitor the quality of a broadband radio, and change the path based on an IP SLA.  This is achieved by changing the running configuration of a router, (adding or removing configuration).

This issue im having is when the IP SLA detects abreach  of set threshold, the event manager running the cli commands, and when the IP SLA detects that the service is now working normally, the same commands are issued to the router. Where as im trying to have the Event Manager issue the opposite commands.

configuration thus far:

ip sla 911

udp-jitter 10.20.9.254 16384 source-ip 10.20.9.252

tos 40

threshold 50

timeout 150

frequency 30

ip sla schedule 911 life forever start-time now

ip sla reaction-configuration 911 react jitterAvg threshold-value 50 1 threshold-type average

ip sla reaction-configuration 911 react connectionLoss threshold-type immediate action-type trapAndTrigger

ip sla reaction-configuration 911 react packetLossDS threshold-value 5 1 threshold-type average

ip sla reaction-configuration 911 react packetLossSD threshold-value 5 1 threshold-type average

event manager applet EVENT_POOR_RADIO

event tag 1.0 ipsla operation-id 911 reaction-type connectionLoss

event tag 1.1 ipsla operation-id 911 reaction-type icpif

event tag 1.2 ipsla operation-id 911 reaction-type packetLossDS

event tag 1.3 ipsla operation-id 911 reaction-type packetLossSD

trigger

  correlate event 1.0 or event 1.1 or event 1.2 or event 1.3

  attribute tag 1.0 occurs 1

  attribute tag 1.1 occurs 1

  attribute tag 1.2 occurs 1

  attribute tag 1.3 occurs 1

action 1.0 cli command "enable"

action 1.1 cli command "configure term"

action 1.2 cli command "router ospf 20"

action 1.3 cli command "no network 10.40.9.0 0.0.0.127 area 0"

action 1.4 cli command "ip route 0.0.0.0 0.0.0.0 null0"

thoughts?

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

You need to check $_ipsla_condition:

action 1.3 if $_ipsla_condition eq "Occurred"

action 1.4  cli command "no network 10.40.9.0 0.0.0.127 area 0"

action 1.5  cli command "ip route 0.0.0.0 0.0.0.0 null0"

action 1.6 else

action 1.7  cli command "network 10.40.9.0 0.0.0.127 area 0"

action 1.8  cli command "no ip route 0.0.0.0 0.0.0.0 null0"

action 1.9 end

View solution in original post

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

You need to check $_ipsla_condition:

action 1.3 if $_ipsla_condition eq "Occurred"

action 1.4  cli command "no network 10.40.9.0 0.0.0.127 area 0"

action 1.5  cli command "ip route 0.0.0.0 0.0.0.0 null0"

action 1.6 else

action 1.7  cli command "network 10.40.9.0 0.0.0.127 area 0"

action 1.8  cli command "no ip route 0.0.0.0 0.0.0.0 null0"

action 1.9 end

worked!

Thanks for your help Joseph

To Dampen the restoration to ive used the following:

event EVENT_POOR_RADIO

event tag 1.0 ipsla operation-id 911 reaction-type packetMIA

event tag 1.2 ipsla operation-id 911 reaction-type packetLossDS

event tag 1.3 ipsla operation-id 911 reaction-type packetLossSD

trigger

  correlate event 1.0 or event 1.2 or event 1.3

  attribute tag 1.0 occurs 1

  attribute tag 1.2 occurs 1

  attribute tag 1.3 occurs 1

action 005   if $_ipsla_condition eq "Occurred"

action 010    cli command "enable"

action 015    cli command "configure term"

action 020    cli command "router ospf 20"

action 025    cli command "passive-interface GigabitEthernet0/0.10"

action 026    cli command "no event manager applet TIMER"

action 030   else

action 035    cli command "enable"

action 040    cli command "configure term"

action 045    cli command "event manager applet TIMER"

action 050    cli command "event timer countdown time 3600"

action 055    cli command "action 005 syslog msg $q PRIMARY PATH RESTORED$q"

action 060    cli command "action 010 cli command $q enable$q"

action 065    cli command "action 015 cli command $q configure term$q"

action 070    cli command "action 020 cli command $q router ospf 20 vrf SCADA$q"

action 075    cli command "action 025 cli command $q no passive-interface GigabitEthernet0/0.10$q"

action 080    cli command "action 030 cli command $q end$q"

action 085   end