I am trying to write my first EEM script. The goal is that whenever someone change the config, a backup is written on flash.
I have the following:
file prompt quiet
event manager applet ConfigSync
event syslog occurs 1 pattern "\%SYS-5-CONFIG_I: Configured" maxrun 90
action 1.0 cli command "enable"
action 2.0 cli command "copy running bootflash:/latest-cfg"
but it doesn't seem to work. Any ideas ?
(the script is triggered, when i add a syslog action, i see the log, so that works)
No, you won't create a loop since only one instance of the policy can run at one time.
I'm betting your problem is with command authorization. If you are using AAA command authorization, you may have to add:
event manager session cli username USER
Where USER is a username which is authorized to run the specified CLI commands.