cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2687
Views
3
Helpful
2
Replies

N7k: Use of $(TIMESTAMP) in eem applet

pille1234
Level 3
Level 3

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

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

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.

Hi Joseph,

I find it strange that a system variable is already there and can be used with a scheduler job but not with eem, but that seems to be the situation as it is today.

Thanks for your help anyway

regards

Pille

Review Cisco Networking for a $25 gift card