EEM applet for IPSLA

Hi,
I have a scenario where i would like to execute a EEM applet for running an ip sla event when othe ip sla event is up. Just to summarize an IP sla event success should trigger anothe IP sla event. I have tried the two options below but was not able to find any debug logs.
ip sla 10
icmp-jitter x.x.x.x source-ip x.x.x.x num-packets 10
frequency 30
ip sla schedule 10 life forever start-time now
ip sla 20
icmp-jitter x.x.x.x source-ip x.x.x.x num-packets 10
frequency 30
event manager applet SLA
event timer cron cron-entry "5 * * * *"
event ipsla operation-id 10 reaction-type timeout
action 10   if $_ipsla_condition eq "Occurred"
action 15    cli command "enable"
action 20    cli command "configure term"
action 25    cli command "no ip sla schedule 20 life forever start-time now"
action 30    else
action 35    cli command "enable"
action 40    cli command "configure term"
action 45    cli command "ip sla schedule 20 life forever start-time now"
action 50   end
OR
ip sla 10
icmp-jitter x.x.x.x source-ip x.x.x.x num-packets 10
frequency 30
ip sla schedule 10 life forever start-time now
ip sla 20
icmp-jitter y.y.y.y source-ip y.y.y.y num-packets 10
frequency 30
track 1 ip lsa reachability
event manager applet SLA-1
event timer cron cron-entry "5 * * * *"
event track 1 state up
action 10 cli command "enable"
action 20 cli command "conf t"
action 30 cli command "ip sla schedule 20 life forever start-time now"
action 40 cli command "end"
event manager applet SLA-2
event timer cron cron-entry "5 * * * *"
event track 1 state down
action 10 cli command "enable"
action 20 cli command '' conf t"
action 30 cli command "no ip sla schedule 20 life forever start-time now"
action 40 cli command "end"
Regards,
Sathvik K V

Hi Joseph,
I would like to run the script pasted below during buisness hours(9am to 6pm).  When two if conditions are used is it the first condition is checked and if that passes it will check the second condition.
event manager applet APP-1
event track 1 state up
action 001 cli command "enable"
action 002 cli command "show clock"
action 003 regexp "([0-9]+):[0-9]:[0-9]" $_cli_result match hour
action 004 if $hour ge 9
action 005 cli command "conf t"
action 006 cli command "ip sla 2"
action 007 cli command "icmp-echo x.x.x.x source-ip x.x.x.x"
action 008 cli command "frequency 30"
action 009 cli command "ip sla schedule 2 life forever start-time now"
action 010 end
action 011 if $hour le 18
action 012 cli command "ip sla 2"
action 013 cli command "icmp-echo x.x.x.x source-ip x.x.x.x"
action 014 cli command "frequency 30"
action 015 cli command "ip sla schedule 2 life forever start-time now"
action 016 end
event manager applet APP-2
event track 1 state down
action 10 cli command "enable"
action 20 cli command "conf t"
action 30 cli command "no ip sla 2"
action 40 cli command "end"
Regards,
Sathvik

Similar Messages

  • EEM Applet Using IPSLA ED

    After reading the docs on the IPSLA ED, I decided to write the following applet just to see if I understand how to use it.
    ip sla responder
    ip sla enable reaction-alerts
    ip sla 1
    udp-jitter 210.210.210.1 16384 num-packets 100 interval 20
      request-data-size 172
      tos 176
    ip sla schedule 1 start-time now life forever
    ip sla reaction-configuration 1 react jitterDSAvg threshold-value 35 30 threshold-type consecutive 3
    ip sla reaction-configuration 1 react jitterSDAvg threshold-value 35 30 threshold-type consecutive 3
    ip sla reaction-configuration 1 react rtt threshold-value 225 200 threshold-type consecutive 3
    ip sla reaction-configuration 1 react packetLossSD threshold-value 2 1 threshold-type consecutive 3
    ip sla reaction-configuration 1 react packetLossDS threshold-value 2 1 threshold-type consecutive 3
    event manager applet VoIP-Test-Alert
    description "Send syslog msg if rrt delay > 225 or jitter > 35 ms or packet loss > 2%”
    event tag e1 ipsla operation-id 1 reaction-type jitterDSAvg
    event tag e2 ipsla operation-id 1 reaction-type jitterSDAvg
    event tag e3 ipsla operation-id 1 reaction-type rtt
    event tag e4 ipsla operation-id 1 reaction-type packetLossSD
    event tag e5 ipsla operation-id 1 reaction-type packetLossDS
    trigger occurs 1 period 360
    correlate event e1 or event e2 or event e3 or event e4 or event e5
    action 1.0 if $_ipsla_measured_threshold_value gt $_ipsla_threshold_rising
    action 2.0    syslog priority notification msg "$_ipsla_react_type = $_ipsla_measured_threshold_value is over threshold   $_ipsla_threshold_rising to destination $_ipsla_dest_ip_addr”
    action 3.0 end
    Seems to work but I cannot figure whether using applets if it is possible to expend this by having another applet realize that all my reactions for IP SLA 1 are under their falling theshold and thus issue a syslog message that all is A-OK.
    thx in advance for any suggestions.

    Thank you.  That would do it for that but now I have another issue.
    I want to expand my applet so only one applet would be all that is needed to alert for ip sla tests to multiple targets so I tried yesterday to expand my applet to somethink like the following:
    event manager applet VoIP-Test-Alert
    description "Send syslog msg if rrt delay > 225 or jitter > 35 ms or packet loss > 2%”
    event tag e1 ipsla group-name 1 reaction-type jitterDSAvg
    event tag e2 ipsla group-name 1 reaction-type jitterSDAvg
    event tag e3 ipsla group-name 1 reaction-type rtt
    event tag e4 ipsla group-name 1 reaction-type packetLossSD
    event tag e5 ipsla group-name 1 reaction-type packetLossDS
    trigger occurs 1 period 360
    correlate event e1 or event e2 or event e3 or event e4 or event e5
    I then used the ip sla schedule command to put ip sla operation-id 1 into schedule group id 1.  But when I tested, I got the Ip SLA threshold exceeded syslog messages but my applet failed to trigger.
    I am not understading something here in regards to IP SLA ED use of group-name.   In IP SLA  schedule group ids are integers while in the applet group-name are strings.  Thus I suspect I am not correctly creating the ip sla group correctly.
    Thanks in advance again for any help.

  • Drawbacks of EEM applet

    As i am going to configure EEM applet for TFTP backup on my cisco production device, I want to know weather there are any drawbacks of EEM applet like resources consumtion etc.

    Hi Joseph,
    I am going to use below applet for Automatic TFTP backup.
    action 1 cli command "enable"
    action 2 cli command "configure terminal"
    action 3 cli command "file prompt quiet"
    action 4 cli command "end"
    action 5 cli command "copy running-config tftp://tftp-server/router-confg"
    action 6 cli command "configure terminal"
    action 7 cli command "no file prompt quiet"
    action 8 cli command "end"
    Do I need to take any precautions during this applet configuration ?

  • Eem applet or script for sending email for syslog denies

    I am wanting to have my isr's send an email when a certain number of deny's occur on an ace.  So if i have a particular ace set up to log when tcp 3389 denied.  Then the eem applet or script would track when that deny entry happens.  When the deny hits on that entry reach three times, it will send an email alert.  The thing i am wondering about is how to set a variable within an event syslog pattern statement.  For instance, how do i say express a variable for the source ip/port in the below
    config-applet)# event syslog pattern "SEC-6-IPACCESSLOGP: list 198 denied tcp 201.198.71.51(38531) -> 212.184.81.52(3389)" occurs 3
    The source ip and port could rotate or change so i'd need to express that with some kind of variable.  How could that be done?(or is there a better approach altogether). 

    I put the below script in and it takes fine but does not send email alert.  Is there something more to do for configuring email sending? 
    event manager applet Intrusion-Tracking
    event syslog pattern "SEC-6-IPACCESSLOGP:.*-> 208.195.174.115\(3389\)" occurs 3
    action 1.0 mail server "173.16.7.2" to ".[email protected]" from ".eem@company1." subject ".intrusion_alert_from_c2900isr." body "Intrustion alert c2800isr"

  • EEM applet does not support extended ping ?

    Hi does anybody know if EEM applet does not support any extended Ping in a cli action ?
    This works:
    action 1000 cli command "ping ip 10.161.255.5"
    These statements does not work ?
    action 1000 cli command "ping ip 10.161.255.5 repeat 10 source Loopback0"
    action 1000 cli command "ping vrf TESTVRF ip 10.161.255.5 repeat 20 source Loopback0"
    I  found another possibility how to achive extended ping in EEM like following
    event manager applet ping
    event none sync yes
    action 100 cli command "enable"
    action 101 cli command "ping" pattern "[ip]"
    action 102 cli command "ip" pattern "address"
    action 103 cli command "10.161.255.5" pattern "count"
    action 104 cli command "20" pattern "size"
    action 105 cli command "100" pattern "seconds"
    action 106 cli command "2" pattern "commands"
    action 107 cli command "y" pattern "interface"
    action 108 cli command "Loopback0" pattern "service"
    action 109 cli command "0" pattern "header"
    action 110 cli command "no" pattern "data"
    action 111 cli command "no" pattern "pattern"
    action 112 cli command "0xABCD" pattern "Verbose"
    action 113 cli command " " pattern "size"
    action 114 cli command "n" event manager applet ping
    bu there is also no way to specify the VRF ?
    Any Ideas ?
    Thx
    Hubert

    Hi found failure,
    extended ping needs to be executed in priviledged mode, so need to enable in advance , then it works
    thx Bruno for the hint
    Hubert

  • Auto Email on event - EEM script for NxOS

    I generated EEM script for Duplicate IP address detection, but i do not know how to trigger email in NxOS.
    event manager environment emailto "[email protected]"
    event manager applet Duplicate_IP
      description "Detect Duplicate IP and Send Trap"
      event syslog pattern "%ARP-2-DUP_SRC_IP"
      action 1.0 snmp-trap strdata "Duplicate IP Detected on Host $hostname"
      action 2.0 cli sh logg last 100
      action 3.0 event-default
    Somebody know how to trigger email. There is no good document on EEM email triggering mechanism.

    Not sure if this would work in NxOS but I think it would go something like this;
    Specify the action of sending a short e-mail when the EEM applet is triggered via the event syslog pattern you already have defined:
         Router(config-applet)#  action label mail server server-address to to-address from from-address subject subject body body-text
    Remember to define the EEM environment variables first when setting up the applet as follows:
       event manager environment  _email_server
       event manager environment  _email_to
       event manager environment  _email_from

  • EEM Applet - Interface bandwidth utilization

    We are planning to get syslog or snmp alert for bandwidth utilization of Uplinks by EEM applet, can any bdy help me on that?
    We managed to get alert for input traffic but we are not able to get alert for total bandwidth utilization ( input + output ).

    This is possible with an EEM applet.  I have done it on G1 ISRs with 15.1.  The applet is here:
    http://ephemeralportal.blogspot.jp/2014/01/eem-applet-teach-your-router-to-monitor_24.html
    I usually run 12.4 on 3745s in GNS3 and they do not have the action set to do variable manipulation, so I am guessing that this is a newer feature, although I could not find what minimum version you would need on a quick search.

  • EEM applet to reload router after ip is unreachable over time

    Hi
    I am trying to create an EEM applet that will track the reachability of a group of  IP addresses. The condition needs to be as followed:
    If the IP addresses become unreachable for about an 1 hour 15 minutes then reload the router. I have looked at the delay command using the IP SLA option but it only delays up to 180 seconds. Any Ideas?

    The applet that tracks your IP SLA objects (I'm guessing you have a tracked object that tracks a list of other objects) should configure another timer applet that counts down the time you want.  For example:
    event manager applet track-down event track 3 state down action 1.0 cli command "enable" action 2.0 cli command "config t" action 3.0 cli command "event manager applet countdown" action 3.1 cli command "event timer countdown time 4500" action 3.2 cli command "action 1.0 reload" action 4.0 cli command "end"!event manager applet track-up event track 3 state up action 1.0 cli command "enable" action 2.0 cli command "config t" action 3.0 cli command "no event manager applet countdown" action 4.0 cli command "end"

  • Need help in executing EEM applet only once

    Do we have any sample script for EEM applet counter ?  We want applet to execute once after reload after matching a string . We tried couple of solutions like “ server suspend  “( customer does not like server suspend)   and event counter ( this does not allow syslog string matching ). Please let me know if there are any options.
    At the router reload, match the string , bring down the interface and run this applet only once . I have been trying multiple messages in Bootup log for this for bringing the interface down.
    The issue we are facing is that most of the bootup log messages can be triggered when the router is up as well which will result in triggering of the applet which is what we want to avoid.
    event manager applet Interface_down
    event syslog pattern "SPA removed from subslot 0/0"
    trigger delay 10
    action 1.0 cli command "enable"
    action 1.5 cli command "config t"
    action 2.0 cli command "interface gi0/0/0"
    action 2.5 cli command "shutdown"
    action 3.0 cli command "end"
    event manager applet Interface_up
    event syslog pattern "Bulk Sync succeeded"
    trigger delay 100
    action 1.0 cli command "enable"
    action 1.5 cli command "config t"
    action 2.0 cli command "interface gi0/0/0"
    action 2.5 cli command "no shutdown"
    action 3.0 cli command "end"
    end

    This is a bit dirty but you can create an applet to run at startup that creates the event detection applet. Then at the end of the detection applet, have it remove itself from the running config. This means that the  applet running at startup will always create the event detection applet but the event detection applet will only ever run once for that router boot period as it deletes itself after first run.
    The problem is that when you want to have one applet create another applet, you have issues with the inverted commas being correctly configured for the second applet which will cause it to run once, but fail after that. The way you can get around this is to write the applet to a text file on the flash and then copy the contents of the text file to the running config at boot. This preserves the structure of the applet being created and ensures that it will function correctly.
    The following example builds the event detection applet at system restart (BUILDAPPLET)  by copying the file "eventapplet.txt" to running config. The event detection applet (EVENTDETECT) detects a syslog pattern, in this case exiting global config, and runs the applet sending a puts command and outputting HELLO. The event detection applet then removes itself from the running config.
    !# configure the router
    conf t
    !# turn off file prompting to let the BUILDAPPLET run when copying
    file prompt quiet
    !# create the applet that runs at system restart and copies the flash applet to the running config
    event manager applet BUILDAPPLET
     event syslog pattern "%SYS-5-RESTART"
     action 10 cli command "en"
     action 11 cli command "copy flash:eventapplet.txt running-config"
    !# exit
    end
    !######## Create the flash file containing your run once applet ########
    ! enter the tclsh so we can write our applet to a file - put your event detection applet in here between the {} that you want to run once
    tclsh
    puts [open "flash:eventapplet.txt" w+] {
    event manager applet EVENTDETECT
     event syslog pattern "%SYS-5-CONFIG_I"
     action 1.0 puts "HELLO"
     action 2.0 cli command "en"
     action 3.0 cli command "conf t"
     action 4.0 cli command "no event manager applet EVENTDETECT"

  • New to Java. Want to write a simple applet for a mobile phone.

    Hello,
    I want to write a simple java applet for a mobile phone. currently I am in the stage of thinking about whether this is possible in a timeframe of about a month. I have very little java experience from a while back so I'm pretty much starting from scratch.
    All I want is an applet that lets you send 2 or 3 variables to an online server. The server will then reposition telescopes.
    All i'm concerned with is the mobile phone part, which doesn't have to be secure or impressive. Just a simple interface.
    Ideally it should work on my nokia 6070, which occording to the official specs has the following java technology:
    MIDP 2.0
    CLDC 1.1
    JSR 120 Wireless Messaging API
    JSR 135 Mobile Media API
    Nokia UI API
    (I don't know what any of this means but am a good learner).
    Can anyone offer me any advice? Is this possible in my timeframe? where should I start? I need a editor and compiler also (I'm using windows XP).
    Many thanks and kind regards,
    Jason

    Actually it is working on my phone now.
    I changed the target platform in the wireless toolkit settings to MIDP 1.0
    Now to create the fields coordinate fields etc. I don't have much of a clue really.
    Current I have:
    import java.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class AtmosMIDlet extends MIDlet implements CommandListener
    Form WelcomeForm = new Form("AtmosMIDlet");
    StringItem WelcomeMes = new StringItem(null, "Please enter coordinates:");
    TextField Longitude = new TextField("Longitude", "", 3, TextField.NUMERIC);
    TextField Lattitude = new TextField("Lattitude", "", 3, TextField.NUMERIC);
    public AtmosMIDlet()
    try
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    WelcomeForm.append(logo);
    catch (java.io.IOException x)
    throw new RuntimeException ("Image not found");
    WelcomeForm.append(WelcomeMes);
    WelcomeForm.append(Longitude);
    WelcomeForm.append(Lattitude);
    WelcomeForm.addCommand(new Command("Exit", Command.EXIT, 0));
    WelcomeForm.setCommandListener(this);
    public void startApp()
    Display.getDisplay(this).setCurrent(WelcomeForm);
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    public void commandAction(Command c, Displayable s)
    notifyDestroyed();
    I'm trying to get the image logo.png to display at the top but I get the error:
    C:\WTK25\apps\AtmosSpec\src\AtmosMIDlet.java:19: cannot find symbol
    symbol : constructor ImageItem(javax.microedition.lcdui.Image)
    location: class javax.microedition.lcdui.ImageItem
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    ^
    1 error
    com.sun.kvem.ktools.ExecutionException
    Build failed
    When I try to build.. Any help would be great.
    Ideally the image would be on a seperate screen for a couple of seconds.

  • EEM variable for show command output and create a filename

    I'm configuring EEM applet, example CPU High event. When it triggers the event, action is "show tech | redirect tftp://x.x.x.x/showtechoutput". The EEM event is working fine and triggered the show tech output into the tftp server. My question is, i'd like to add maybe date/time in the filename so it will not overwrite the file everytime there is a triggered event.
    The EEM event variable i'm seeing in doc is "_event_pub_sec" but it won't work when i add after or before the filename. any idea?
    thanks in advance ...

    Adding $_event_pub_sec to the end of the filename should work:
    action 1.0 "show tech | redirect tftp://x.x.x.x/showtech.$_event_pub_sec"
    That said, TFTP is very particular about how files can be created.  Typically, a TFTP server will require the file to exist before a remote host can copy to it.  If the filename changes each second, this will not work.  Using a protocol like FTP or SCP may work better.

  • EEM Applet Problem With: event syslog pattern ".*" priority 2

    I went to create a EEM applet that would be invoked whenever any syslog message of priority 0-2 was invoked. I figured  the following event statement would work
           event syslog pattern ".*" priority 2
    I never really used the priority optional argument before but thought I understood from the docs that messages at or numerically lower than the specified level are matched.
    Well it doesn't seem to work as documented.  Seems to me that only messages at the specified level are beng matched and not messages numerically lower than the specified level.
    Anyway I did what I wanted differently but wanted to post this in case this is a bug in the syslog ed.

    Actually, it's a problem with the documentation.  The priority option only matches the specified severity.  What you could do is adjust pattern to do this:
    event syslog pattern "*-[012]-"

  • Dynamic java applet for binary search tree

    dynamic java applet for deleting an element of a tree at any specified locationin the tree.

    sorry, having thought a bit more about it let me try to be more correct and concrete. say i have feature a at arbitrary chromosome position 7 and features b at positions 1, 2, 3, 5, 6, 9, 10. right now i have to get the closest distance (Math.abs(7-6)) by doing brute force comparison of all values (Math.abs(7-1), Math.abs(7-2), so on). what i want to do is set up a binary tree thus (please forgive poor ASCII):
    5
    2 9
    1 3 6 10
    and get back the keys that the tree tried (since i know that 7 is not in the tree and a traditional binary search e.g. TreeMap.get(new Integer(7)) will return a null). i should get back 5, 9, 6, in an array/ArrayList and be able to find the closest feature b in three comparisons rather than 7. that doesn't seem like much but when you have a million b features the difference between 1000000 comparisons and log2(1000000) is pretty appreciable. so i am wondering if there is an extant class that will give me back the trace of attempted keys through a binary tree as described or, if not, if this would be horribly difficult to implement as an extension of TreeMap.

  • Help regarding applet for querying client's MAC?

    Please help with an applet and java code that uses Runtime.getRuntime().exec("ipconfig -all") and gets the client's machine MAC address?
    If any one already worked with applets for querying client mahchine MAC , please give me a solution.

    remus.dragos wrote:
    vasu.mtech wrote:
    I am giving an explanation where I want this:
    We have an application, where user will be given a specific machine(with one MAC) and have to login from there only. If he tries to login from different machine with same user id, we should throw an error message. That's concept. We know that this reduces/kills operatability of the user from different machines.
    But we shouldn't allow the user operating from diffrent machines.What happens if the admins NIC burns? And he gets a news one? He can't log in until you manually change his
    MAC in the database ???Database? That's not secure!
    It has to be hardcoded into the exe (guess what the kid's next question will be?).

  • What is the canonical name of icloud applet for windows?

    Hi, I am trying to determing the canonical name of the icloud applet for windows.  Does anyone know it?

    To expound a bit, within win7 control panel sits "iCloud".  I am attempting to hide the applet from being visible in control panel using group policy editor.  No big deal really, the hard part is determining the cononical name.  I have tried it in ways akin to other names, but no dice.  Here are some samples:
    Control Panel Item
    Canonical name
    GUID
    Action Center
    Microsoft.ActionCenter (Windows 7 and later only)
    {BB64F8A7-BEE7-4E1A-AB8D-7D8273F7FDB6}
    Administrative Tools
    Microsoft.AdministrativeTools
    {D20EA4E1-3957-11d2-A40B-0C5020524153}
    AutoPlay
    Microsoft.AutoPlay
    {9C60DE1E-E5FC-40f4-A487-460851A8D915}
    Backup and Restore
    Microsoft.BackupAndRestore (Windows 7 and later only)
    {B98A2BEA-7D42-4558-8BD1-832F41BAC6FD}
    Biometric Devices
    Microsoft.BiometricDevices (Windows 7 and later only)
    {0142e4d0-fb7a-11dc-ba4a-000ffe7ab428}
    BitLocker Drive Encryption
    Microsoft.BitLockerDriveEncryption
    {D9EF8727-CAC2-4e60-809E-86F80A666C91}
    Color Management
    Microsoft.ColorManagement
    {B2C761C6-29BC-4f19-9251-E6195265BAF1}
    Credential Manager
    Microsoft.CredentialManager (Windows 7 and later only)
    {1206F5F1-0569-412C-8FEC-3204630DFB70}
    Date and Time
    Microsoft.DateAndTime
    {E2E7934B-DCE5-43C4-9576-7FE4F75E7480}

Maybe you are looking for

  • Ejb QL 3.0 group by / return type issues

    Hello all. I have a question regarding ejb query language 3.0. I have a query that works and looks like the following: select e.objectId, count(distinct s1.objectId), count(distinct s2.objectId) from Engagement e JOIN e.surveys s1 JOIN e.surveys s2 w

  • "Warning! Not Enough Memory!" A bug in Logic 7.1?

    Hello, I seem to have discovered a bug in my Logic 7.1, and would like to see if this is a system specific bug, or a bug in everyones Logic. It seems to occur in the Matrix editor which results in the error ""Warning! Not enough memory! This operatio

  • Printing to a pdf seems be partly broken in Acrobat X on XP machine.

    I have just upgraded from Acrobat 7 professional to Acrobat X professional. With Acrobat 7, printing to a pdf file from within a program (MsWord, Visi etc) was a breeze. Now, with Acrobat X on the same machine, the print spooler always reports 'this

  • Abstract method in Interface

    Why are we able to define abstract method in an Interface? I don't imagine when I must use an abstact method in a interface. Does anybody ever use this?

  • Programmatically selecting a cell in a two-dimensional JTable

    The problem is that when a person edits a cell and the value fails validation, I would like to programmatically select the cell. The validation is done in the setValueAt method of a Class extending the AbstractTableModel. By simply returning out of t