cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4684
Views
0
Helpful
7
Replies

EEM Scripting with Multiple conditions

yashvarmap
Level 1
Level 1

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

Yaswanth

7 Replies 7

Joe Clarke
Cisco Employee
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.

Regards

Yaswanth

Hi,

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?

regards,

Ismail

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.

Regards

Yaswanth

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

ip sla 15
 icmp-echo 10.1.1.1
ip sla 16
 udp-jitter 20.1.1.1 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
 trigger
  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 "30.1.1.1" to "user@company.com" from "user@company.com" 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".

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: