N7k: Use of $(TIMESTAMP) in eem applet

Hi there,
I'm trying to copy running-config to tftp-server whenever a "copy run start" was executed.
event manager applet SAVE_TO_TFTP  event cli match "copy running-config startup-config"  action 1.0 cli copy running-config tftp://1.2.3.4/directory/switchname.cfg vrf management  action 2.0 event-default
Works as expected, but I'd like to append the filename with a timestamp. However if i try this
action 1.0 cli copy running-config tftp://1.2.3.4/directory/switchname.$(TIMESTAMP).cfg vrf management
the variable $(TIMESTAMP) will be parsed immediately to this:
action 1.0 cli copy running-config tftp://1.2.3.4/directory/switchname.2013-04-20-18.52.00.cfg vrf management
Is there a way to get the actual eem execution timestamp? When using the same syntax in a scheduler config this works great...
Regards
Pille

I know IOS has such a parameter, but I don't see the same parameter in NX-OS.  The only parameter I know will work is $command (the command that was run).  I did some tests, but I don't see a way to do what you want unless you use EEM to execute a tclsh script.  That will give you the ability to build whatever timestamp you want, but it isn't officially supported.

Similar Messages

  • Using IP SLA and EEM to provide 3G backup to ADSL connection on CISCO887VAG+7-K9 router

    On a Cisco887VAG+7-K9 router, I want to be able to use IP SLA and EEM to track connectivity to an external address via my ADSL line, if connectivity is UP then I want the 3G interface to be admin shutdown.  If connectivity is down, then I want the 3G interface to be activated and connectivity to resume via 3G.
    I have configured this and it works apart from one problem.  If the config on the router is written to startup memory while the 3G interface is admin shutdown, we subsequently have a problem with the ADSL line and the router is then rebooted, then the EEM does not seem to re-activate the 3G interface so all connectivity is lost until the ADSL is returned to service.   i.e. it seems to be the case that if the IP SLA starts off as "Down" then the EEM doesn't take any action.  The IP SLA has to have gone into the "up" state before it starts working?  Does that make sense and, if so, is there any way round it?
    For info, here is my IP SLA and EEM config:
    ip sla 1
    icmp-echo 8.8.8.8 source-interface dialer2
    timeout 60000
    ip sla schedule 1 life forever start-time now
    track 1 ip sla 1 reachability
    ip route 0.0.0.0 0.0.0.0 Dialer2 track 1
    ip route 0.0.0.0 0.0.0.0 Dialer1 20
    event manager applet 3G-ACTIVATE
    event track 1 state down
    action 10 cli command "enable"
    action 20 cli command "configure terminal"
    action 30 cli command "interface Cellular0"
    action 40 cli command "no shutdown"
    action 50 cli command "end"
    event manager applet 3G-DEACTIVATE
    event track 1 state up
    action 10 cli command "enable"
    action 20 cli command "configure terminal"
    action 30 cli command "interface Cellular0"
    action 40 cli command "shutdown"
    action 50 cli command "end"
    Any assistance/advice on getting this to work effectively would be appreciated!
    Thanks.

    Yes, basically, when the tracked object is not reachable on initial router boot, the router doesn’t detect a transition of the tracking object from up to down and therefore does not execute the associated EEM script. 
    So, in my case, if I have an ADSL fault and the 3G interface has taken over, if the router is subsequently rebooted, all connectivity will be lost because the startup config of the router has the 3G interface as admin down and the EEM script to activate it does not kick in.
    I've tried using "default-state up" under the track config but this didn't seem to have any effect - the reachability of my IP SLA was still down after a router reboot with no ADSL connection.
    I also tried your script but this gave the errors:
    %HA_EM-3-FMPD_ACTION_NOTRACK: bump-track: unable to set state for tracking object number 1; object does not exist or is not a stub-object.
    Mar 19 10:23:00.005: %HA_EM-3-FMPD_ERROR: Error executing applet bump-track statement 1.0 %HA_EM-3-FMPD_ACTION_NOTRACK: bump-track: unable to set state for tracking object number 1; object does not exist or is not a stub-object.
    Mar 19 10:23:00.005: %HA_EM-3-FMPD_ERROR: Error executing applet bump-track statement 1.0
    I'm not sure how to resolve that?
    Any further advice would be welcome!  Thanks.

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

  • 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

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

  • Using a filechooser in an applet

    Is it possible to use a filechooser for an applet save button? If so how can you do it? So far I have only been able to use the filechooser object with JFrame and not JApplet.

    Hi,
    I'm a newbie, but I just had a similar problem and the solution was in the html code to display the applet. here's the code:
    <applet width=700 height=500 code="ImageExample.class"> </applet>
    make sure the height and width here are big enough for your imaage.
    HTH
    Paul

  • Using a main in an Applet

    Hello, I have a question.
    How do you use a mian in an Applet.
    Eample, after an applet section is complete, I want it to go into Console use. Does anyone know how to combine the two? Thanks
    Note: So far, I got the program to go into the Console but It stops working when it asks for user input. There are no "String args[]" and that is what I hypothesis is the error

    import javax.swing.*;
    public class MyApplet extends JApplet {
         public void init() {
              //init stuff here
         public void start() {
              //start stuff here
         public static void main(String[] args) {
              JFrame f = new JFrame();
              JApplet a = new MyApplet();
              f.getContentPane().add(a);
              f.setSize(600, 400);
              f.setVisible(true);
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              a.init();
              a.start();
    }Excuse me, but is there a way to do this on Applet only instead of JApplet... I was told we need to use Applet only...

  • How to Use DLL Function in Java Applet

    Hi all,
    I have been assigned a task to develop java applet. The problem is, I need to use DLL functions in my applet to read records. Could you pls anyone guide me how to interface DLL and applet to read records with sample code?
    I'm using JDK 1.5.0_06 and Windows XP OS. thanx..
    best rgds,
    jpdbay

    You will need to use Java Native Interface JNI. Ther are many posts on the subject, please search, and this is the documentation:
    http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

  • How to use between timestamp in where clause

    Hi All,
    i have a colum column2 of data type timestamp.now i wants to fatch record having between two date of column2.how to use between operator in where condition having column as timespamp'

    Hi,
    You can use a timestamp literal, or use a function that return a timestamp datatype, here is an example:
    (TIMESTAMP 'YYYY-MM-DD HH24:MI:SS.FF')
    select * from yourtable where column2 between TIMESTAMP '1997-01-31 09:26:50.12' and  systimestampHave a look to the documentation, for example http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch4datetime.htm

  • Use of Timestamp field in Syndicator selection.

    Hi Expertes ,
    I have a timestamp field in repository to check the updates for some 2-3 fields & I want to use This timestamp fieldas selection parameter for syndication. ie. basically to syndicate the records only if timestamp = Today or current date . Do you know How this can be done ?
    Thanks,
    K .Anand

    Hi Anand,
    I faced this kind of a requirement. Actually I doubt whether this can be achieved by syndicator.
    However I can give you a Workaround.
    You can write a Validation which will compare the Time stamp value and the System Time. Keep the difference as 1 second.
    Use the Validation in a Workflow.
    So as soon as any of those 2 or 3 fields gets updated, the Workflow will automatically catch them and then you can use the SYNDICATE stencil and the records will get syndicated to the port you mention.
    This is how I was able to do it.
    Hope it helps.
    *Please reward points if found useful.
    Thanks and Regards
    Nitin jain

  • 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

  • Problem with using isAuthenticate method in my applet

    Hi everyone
    I want to be sure that everytime that I select my applet the secure channel has been opened. I found isAuthenticate method from SecurityService Interface and I think that I can use this method in my applet's select method for this purpose. But when I declare an object as this type like this:
    SecurityService Objsecurity;
    to use its isAuthenticate method , I'm able to build my code and make the cap file successfully but I recieve error 6F F6 while loading my applet, And I can't find the meaning of this error in GP.
    I'll appreciate it if anyone could tell me how can I use this method in my applet .
    And the other question is is there any other way to find out the authentication have been done or not?
    Best Regards
    Shili

    Hi Pedja,
    Thanks for the prompt reply.
    I have been following the link you mentioned to create ADF security and successfully implementedthe first part where if i directly give any internal page url it redirects me back to login page.
    Instead of using weblogic-sql authenticator, i wanted to manually authenticate the user in loginbean.java where i check the username passowrd against the db.
    I had also implemented the method to access username,password mentioned in the following thread
    Re: ADF security on my jspx  page as login page
    Insted of using authentication.login, i am calling the db method to do the validation.
    The thing is after my db validation it does redirect me to the success page(menu.jspx). but when i click links on menu.jspx it redirects me back to login page.
    so i understand that user is not yet set in the session.
    I am stuck at the point how do i code the login.jspx, currently my login.jspx does not have any j_security_check and i think this is what is creating the problem.
    while searching for adding jsecurity in jspx i landed on the blog of 2006 and started using that.
    Can you please point me to some link which explains how to code login.jspx , i have been trying hard for couple of days.
    Thanks again
    ash

  • How to use IE proxy with an applet and a socket ???

    Hello!
    I need to make an applet running with Internet Explorer.
    This applet uses socket and sends http request to a server (the server where the
    applet is).
    It's ok but it doesn't work when my IE uses a proxy.
    My question is: how my applet can makes a socket using the IE proxy ?
    My applet can be used by many users, so it has to work with or without proxy, and has
    no need no configuration.
    Thanks for your help.

    Check for the system environment variable for "ie.proxy" in your applet code, if it returns something then use the proxy server, if not then ignore it.
    However, as a rule of thumb unless your IE Security settings enable applets to access URLs, then it won't work. Next, speaking in general java - applets can only access resources (URLs) from the applet's originating server (i.e. the server where the applet exists).
    If IE uses a proxy, then your applet should automatically use it, unless as I metioned before, your IE Security does not allow permission for the applet to do so. Check Tools - Internet Options - Security - Java - Advanced options.

  • How to use C-Structure in java applets

    hi alls,
    I want to use a struct model (struct in C++) in java applets. i know class is used in java applications. but, how can i convert in java applets?
    class renk
    int r;
    int gr;
    int b;
    import java.awt.Graphics;
    import java.awt.Color;
    import java.awt.Event;
    import java.applet.Applet;
    public class benek extends Applet
    final int n=10;
    int x[] = new int[n];
    int y[] = new int[n];
    int count = 0;
    renk clr[] = new renk[n];
    public void init()
    setBackground(Color.black);
    public boolean mouseDown(Event yordam, int xyer, int yyer)
    if (count<n)
    System.out.println("...");
    ekle(xyer,yyer);
    else System.out.println("Kapasite Doldu...");
    return true;
    void ekle(int xyer, int yyer)
    int r1 = (int)Math.floor(Math.random()*256);
    int gr1 = (int)Math.floor(Math.random()*256);
    int b1 = (int)Math.floor(Math.random()*256);
    clr[count].r = r1;
    clr[count].gr = gr1;
    clr[count].b = b1;
    x[count]=xyer;
    y[count]=yyer;
    count++;
    repaint();
    public void paint(Graphics g)
    it gives error message... how can � use struct model in java applets???
    if you help me i will be greatfull....

    � use import but it doesn't work.
    i add: import renk; or import class renk;
    how will � add import I assumed based on your initial post that the renk and benek classes were in the same file. Apparently you're saying they are not. So for another thing, make your renk class "public class renk", and add the "public" keyword to the 3 members of that class. Then if your code still doesn't see the "renk" class, it would just be that you don't have the directory that contains the compiled "renk.class" in your classpath.

Maybe you are looking for