Showing results for 
Search instead for 
Did you mean: 

EEM Scripting with Multiple conditions

Hi Netpros,

I have created an applet which tracks the latency and takes the specified action if the same goes beyond the threshold. It is working pretty well but the point I just want to understand is that whether is there any option in EEM to check multiple conditions such as the specified condition should trigger only if

  • Latency goes beyond 100ms and Packet loss is more than 5%
  • Latency goes beyond 50ms or packet loss is more than 8%

The point I want to understand is that whether we can perform boolean operations within a single applet with two different conditions ?

Thanks in advance


Joe Clarke
Hall of Fame Cisco Employee

Yes, you can.  EEM policies can have multiple conditions since EEM 2.4.  If you're using IPSLA for this, you will need two reaction configurations to track both latency and packet loss.  Then you can configure EEM to do an "and" trigger on both:

event tag latency ipsla reaction-type rtt ...

event tag loss ipsla reaction-type packetLossSD

trigger period 1

correlate event latency and event loss

Hi Joe,

Thanks for your response.

Could you please help me with an example which makes the interface Gig0/1 down when one of the conditions met [ either latency goes beyond 100 ms or packet loss is more than 5%] within a single applet.

Thanks in advance.




I am trying to create an IPsla monitor to check latency only.  If it goes above say 100 ms I want to trigger an action.  Please can you post the IPsla config you created to track latency?



Hi Ismail,

I just want to understand your requirement clear. You can associate the IP SLA track object to any of the applications when the latency goes beyond the threshold.



Joe Clarke
Hall of Fame Cisco Employee

Here is a sample config.  Let's assume that is the server to test for latency and is the IOS device running "ip sla responder" to use for testing loss.  This should do what you want:

ip sla 15
ip sla 16
 udp-jitter 16384 num-packets 100
ip sla schedule 113 life forever start-time now
ip sla reaction-configuration 15 react rtt threshold-value 150 10 threshold-type immediate action-type trapOnly
ip sla reaction-configuration 16 react packetLossSD threshold-value 2 1 threshold-type immediate action-type trapOnly
ip sla logging traps
ip sla enable reaction-alerts
ip sla schedule 15 start-time now life forever
ip sla scheduler 16 start-time now life forever
event manager applet link-health
 event tag latency ipsla operation-id 15 reaction-type rtt
 event tag loss ipsla operation-id 16 reaction-type packetLossSD
  correlate event latency or event loss
 action 001 if $_ipsla_condition eq "Occurred"
 action 002  cli command "enable"
 action 003  cli command "config t"
 action 004  cli command "int gi0/0"
 action 005  cli command "shut"
 action 006  mail server "" to "" from "" subject "Shutting down link" body "Shutting down Gi0/0 do to high loss/latency"
 action 007  cli command "end"
 action 008 end

Hi Joe,

    Very good example !

    What makes me confused is that where "5%" is. Could you please help me to explain?

Hi Joe,

    Thx and please ignore my question. I mistood the meaning of "threshold".

Content for Community-Ad