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

EEM $_ipsla_condition variable states

Pkirchgessner1
Level 1
Level 1

I am trying to build an EEM applet on a 3850 switch that will shut a port off when an sla echo times out and no shut's the port when the sla starts receiving a reply. My problem is I don't believe that I am checking the right state in my if logic because the applet triggers but never enters the if/true actions. I have not been able to find what states are available for the built-in environment variable $_ipsla_condition. Where can I find documentation for that variable. Below is my code:

ip sla 110
 icmp-echo 192.168.35.250 source-ip 192.168.0.239
 frequency 5
ip sla schedule 110 life forever start-time now
ip sla reaction-configuration 110 react timeout threshold-type immediate action-type trapAndTrigger

event manager environment interface_to_shut GigabitEthernet1/0/48

event manager applet Shut_Main_Uplink
 event tag 1.0 ipsla operation-id 110 reaction-type timeout
 trigger
  correlate event 1.0
  attribute tag 1.0 occurs 1
 action 1.0 if $_ipsla_condition eq "Occured"
  action 1.1  cli command "enable"
  action 1.2  cli command "conf t"
  action 1.3  cli command "int $interface_to_shut"
  action 1.4  cli command "shut"
  action 1.5  cli command "end"
  action 1.6  syslog priority errors msg "192.168.0.250 unpingable; shutting down $interface_to_shut"
 action 2.0 else
  action 2.1  cli command "enable"
  action 2.2  cli command "conf t"
  action 2.3  cli command "int $interface_to_shut"
  action 2.4  cli command "no shut"
  action 2.5  cli command "end"
 action 2.6 end

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

Your applet is right (but you don't need the tag and correlate stuff as you only have one event).  The value of Occurred is what you'll see when the threshold is crossed.  What you're missing is:

 

ip sla enable reaction-alerts

ip sla logging traps

View solution in original post

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

Your applet is right (but you don't need the tag and correlate stuff as you only have one event).  The value of Occurred is what you'll see when the threshold is crossed.  What you're missing is:

 

ip sla enable reaction-alerts

ip sla logging traps

Sorry, i must have missed copying the command to enable reaction-alerts. Once I added the "ip sla logging traps" I see it log the threshold occurred....

Doh, I see I typo'd Occurred. Thanks for your help with logging the traps

 

Review Cisco Networking for a $25 gift card