03-26-2014 08:36 AM
Hi
I have the following EEM Policy that I thought would remove itself then perform a 'write mem' but the policy seems to terminate at the point it removes itself from running config without the final 'write mem', I am running the below EEM version which I have read will no longer run to completion after the policy removes itself to prevent runaway policies, is there a way to achieve the final 'write mem' after policy removal, if it doesn't save to startup it will run every time the router reboots.
Thanks
Rick
Embedded Event Manager Version 3.20
Component Versions:
eem: (320_rel2)2.0.3
event manager applet crypto_key
event timer cron cron-entry "@reboot" maxrun 60
action 1.0 cli command "enable"
action 1.1 cli command "config t"
action 1.2 cli command "crypto key generate rsa modulus 2048"
action 1.3 cli command "interface Gi0/0"
action 1.4 cli command "no shut"
action 1.5 cli command "end"
action 1.6 cli command "write mem" pattern ".*"
action 1.7 regexp "confirm" $_cli_result
action 1.8 if $_regexp_result eq 1
action 1.9 cli command "y"
action 2.0 end
action 2.1 cli command "config t"
action 2.2 cli command "no event manager applet crypto_key"
action 2.3 cli command "end"
action 2.4 cli command "write mem"
!
Solved! Go to Solution.
03-27-2014 10:47 PM
Newer versions of IOS do not terminate the policy when you unconfigure it. However, if your version causes the policy to terminate, then your workaround would be fine.
03-27-2014 08:33 AM
I worked around the issue with a hack, adding a second EEM applet to do the write mem with a countdown timer.
!
event manager applet write_mem
event timer countdown time 80
action 1.0 cli command "enable"
action 1.1 cli command "write mem"
!
Interested to know if there is a better way though.
Rick
03-27-2014 10:47 PM
Newer versions of IOS do not terminate the policy when you unconfigure it. However, if your version causes the policy to terminate, then your workaround would be fine.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide