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"

Similar Messages

  • EEM script to Reload router 1 Time if Dial Fails

    We have a script we use to track objects and if access to these objects fails we reload the router 1 time (see it below). We want to now apply the same script in a different capacity for another customer for dial. If the router fails to connect after trying to round robin thru 4 toll free 800 numbers then reload the router.
    event manager applet vpn_tunnel_rebooter
    event none
    action 1.0 cli command "enable"
    action 2.0 cli command "config t"
    action 3.0 cli command "no event manager applet vpn_tunnel_unreachable"
    action 4.0 cli command "end"
    action 5.0 cli command "write mem"
    action 6.0 reload
    event manager applet vpn_tunnel_up
    event track 456 state up
    action 001 cli command "enable"
    action 002 cli command "config t"
    action 003 cli command "event manager applet vpn_tunnel_unreachable"
    action 004 cli command "event track 456 state down"
    action 005 cli command "action 1.0 policy vpn_tunnel_rebooter"
    action 006 cli command "end"
    Any ideas on how we might accomplish this? I have very little EEM experience :)
    1) Current Object tracking tracks 3 objects, If access to all three is down we go into a 180 sec delay down timer. If they remain down we switch over to dial backup.
    2) We round robin between 4 dial numbers and if access to all 4 fails, we want to reload router "ONE" time
    3) When it comes back up and objects are still unavailable we attempt to dial the 4 numbers again and if it also fails to connect "DO NOT" reload this time.

    Okay, these policies should do what you want. They are all untested as I do not have a dial backup setup. First, you need to register the following applets:
    event manager applet remove-dial-backup-watch
    event syslog pattern "SYS-5-RESTART"
    action 1.0 cli command "enable"
    action 2.0 cli command "config t"
    action 3.0 cli command "no event manager policy tm_check_dial_backup.tcl"
    action 4.0 cli command "end"
    event manager applet watch-track-down
    event track 456 state down
    action 1.0 syslog msg "Track 456 is down, waiting to see if dial backup comes up"
    action 2.0 cli command "enable"
    action 3.0 cli command "config t"
    action 4.0 cli command "event manager policy tm_check_dial_backup.tcl"
    action 5.0 cli command "end"
    event manager applet watch-track-up
    event track 456 state up
    action 1.0 syslog msg "Track 456 is up, removing dial backup watcher"
    action 2.0 cli command "enable"
    action 3.0 cli command "config t"
    action 4.0 cli command "no event manager policy tm_check_dial_backup.tcl"
    action 5.0 cli command "end"
    Then, you need to set an environment variable for the Tcl policy:
    dial_backup_numbers : Comma-separated list of numbers to check
    For example:
    event manager environment dial_backup_numbers 18667143757,18003179379,18886601039,18004434603
    Then INSTALL but do NOT register the attached Tcl policy. That is, copy the attached Tcl policy to your EEM user policy directory, but do not register it.
    Then everything should just work.

  • IP SLA EEM to reload router after ping failure

    Hi,
    I have created the below configuration but it seems to be failing to trigger the reload. Anybody can please comment what is missing here?
    track 1 ip sla 10 reachability
    delay down 180 up 40  ***** this is in sec - since ping freq is 10 sec , after 18 ping failure and 3 mnts track reachability will be down - it will wait 40 sec before declaring UP *****
    ip sla 10
    icmp-echo 172.20.20.153
    threshold 450  **** in millisec it is threshold value - no action will be taken ****
    timeout 500  **** in millisec it is icmp timeout *****
    frequency 10  *** icmp ping every 10 sec *****
    ip sla schedule 10 life forever start-time now
    event manager applet Router-Reload
    event track 1 state down
    action 1.0 syslog msg "Reply timed out; Router will Reload"
    action 1.1 cli command "enable"
    action 1.2 cli command "reload"

    It worked. Thanks Joseph.
    So what was the issue with my approach. Is it the sequence number?

  • EEM Script to reload router only once after tracked object is down.

    event manager applet vpn_tunnel_unreachable
    event track 456 state down
    action 1.0 reload
    I need it to reload only once if tracked object 456 is down. It should reload the router and then if the tracked object is still down it should go into dial backup as it normally would if it did not have the reload script.

    I suggest reposting this question at the other Network Management subforum under Network Infrastructure to get the attention of the resident EEM guru.
    http://forum.cisco.com/eforum/servlet/NetProf?page=netprof&forum=Network%20Infrastructure&topic=Network%20Management&CommCmd=MB%3Fcmd%3Ddisplay_messages%26mode%3Dnew%26location%3D.ee71a02

  • 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.

  • 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"

  • Force applet to reload

    ok, i have an applet running on a website, which is working fine. However, if i make a modification to the code, recompile and place the new class file on the website, without changing the name, then to get the applet to reload, i have to close all open browsers, open the java control panel, delete the class file from the java cache, open the browser again and reload the page, which is driving me nuts (only a short drive :) )
    is there an easier way? I tried using the cache_option = no idea, but with low confidence that i'm doing it right!!! here's the html code i've got at present...
    <HTML>
    <HEAD>
    </HEAD>
    <BODY BGCOLOR="000000">
    <CENTER>
    <APPLET
         code     = "FillRectTest.class"
         width     = "500"
         height     = "300"
         >
    <param name="cache_option" value="no">
    </APPLET>
    </CENTER>
    </BODY>
    </HTML>

    Is it possible that my applet is being cached somewhere inbetween the web server and my computer? After making a change to a class file on the server i delete all copies on my computer ( i did a search of the whole c drive for possible copies ) and reload the web page. But it still returns the old version of the applet!! is my internet service provider caching the class file after i load it say two times? this is driving me crazy... thanks for the disable cache idea, it would have worked quite neatly but for this other problem.

  • 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 ?

  • Applet does not start after JRE 1.5 installation

    Hi,
    When I go to my webpage where I have an applet that requires Java 1.5..the browsers are prompting for Java installation (ActiveX component install on IE or Firefox plugin for JRE installation). But once the Java install completes the applet does not start automatically. The same code used to work nicely with Java 1.4. The applet used to automatically start and run once the JRE install completed. But with JRE 1.5 it does not start. If I do a refresh on the browser it again prompts for java installation. If I open new browser window and go to the URL the applet starts. Please let me know how to get the applet to start automatically after JRE 1.5 installation.
    Thanks,
    Vijay

    We figured out the problem. the CLASSID was not the right one. Once we changed it...its working fine.
    Vijay

  • Applet does not start after Java 1.5 installation

    Hi,
    When I go to my webpage where I have an applet that requires Java 1.5..the browsers are prompting for Java installation (ActiveX component install on IE or Firefox plugin for JRE installation). But once the Java install completes the applet does not start automatically. The same code used to work nicely with Java 1.4. The applet used to automatically start and run once the JRE install completed. But with JRE 1.5 it does not start. If I do a refresh on the browser it again prompts for java installation. If open new browser window and go to the URL the applet starts. Please let me know how to get the applet to start automatically after JRE 1.5 installation.
    Thanks,
    Vijay

    We figured out the problem. the CLASSID was not the right one. Once we changed it...its working fine.
    Vijay

  • 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]-"

  • 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

  • How do I set up security on my linksys router after the i...

    How do I set up security on my linksys router after the install of a net gear wireless pc adapter?

    Setting up your wireless connection in your router.
    1.Open Internet Explorer and type 192.168.1.1 into the address bar.
    2.You will now get a sign-in box, User Name = (Leave Blank)
                                                           Password = admin (all lower case letters)
    3.Once the set-up page opens, click on the Wireless Tab as youwill need to change the settings. A) Wireless Network Mode = Mixed
                  B) Wireless Network Name (SSID) = Choose any name and do not use Linksys.
                  C) Wireless Channel = 1, 6 or 11 is best, so see which work best for you.
                  D) Wireless SSID Broadcast = Enabled.
    4. Now go to the bottom of the page and click on save settings.
    5. Click on the Wireless Security Sub tab.
                  A) Security Mode: WPA
                  B) WPA Algorithms: TKIP + AES
                  C) WPA Shared Key:  Type 24 letters, and numbers using lower and upper case letters
                  D) Group Key Renewal: 3600
    6. Once again go to the bottom of the page and click on Save Settings.
    7. Now you can close out of this page.
    8. You will now need to enter the security info into your computer. I will now give you 2 links, depending which operating system you have, Vista or XP you will follow the one you have.
    Vista = http://www.home-network-help.com/wireless-adapter-configuration-in-vista.html
    XP = http://www.home-network-help.com/wireless-adapter.html
    Now try to make a wireless connection.
    Good Luck,
    Ttech

  • When I click on the button to download the new IOS software, I get a message saying that all the items on my iTouch will be removed.  Will I have to reload everything after updating the software?

    When I click on the button to download the new IOS software, I get a message saying that all the items on my iTouch will be removed.  Will I have to reload everything after updating the software?  Because I had to have my hard drive wiped a while back, I have items on my iTouch that are not in my iTunes.  Is there a way to copy everything on the iTouch into iTunes, if necessary, before I load the new software?

    It is possible to transfer purchases from your iPod back into iTunes before updating the OS. If you had any CDs from your personal collection, these you have to put back into iTunes manually. Hope this helps you & good luck!

  • 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"

Maybe you are looking for