Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

EEM applet to run on reboot

I'm trying to figure out a way to cause an EEM applet to run on any reboot (command line requested reboot or a reboot caused by a power loss).  I can use the syslog event detector but that will only catch command line reboot requests.  

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: EEM applet to run on reboot

The countdown timer policy should work in this case.  After the specified number of seconds expire, the policy should execute.  The countdown will start once the startup config has been loaded into the running config.

6 REPLIES
Hall of Fame Super Blue

Re: EEM applet to run on reboot

Paul

The Cisco expert on EEM hangs out in the Network Infrastructure -> Network Management forum. If you move this thread to that forum you will get much better help.

Jon

Cisco Employee

Re: EEM applet to run on reboot

Syslog should work for you.  Even if a router is power-cycled, you should see a SYS-5-RESTART message on the console when it boots.  An applet such as the following will work:

event manager applet on-boot

event syslog pattern "SYS-5-RESTART"

...

If you need more delay, you can use a countdown policy.  For example:

event manager applet on-boot

event timer countdown time 30

...

This policy will execute 30 seconds after it is registered (on a reload).  The downside of this approach is that the policy will run 30 seconds after it is initially configured as well unless you deploy it directly to the startup configuration.

Cisco Employee

Re: EEM applet to run on reboot

There is also a special cron entry you can use to match on reboot:

event manager applet on-reboot

event timer cron cron-entry "@reboot"

...

New Member

Re: EEM applet to run on reboot

Thanks for the replies!  These do work but the reboot of interest that I want this to work on is a reboot implemented in performing a password recovery.  I know that the config is not loaded in doing a pw recovery until the console user implements a copy start run but I was hoping that once it was copied, that the applet would fire off.  The cron entry you recommended works on a CLI reboot request and a power cycle reboot but if the power cycle reboot also incorporates ctrl+break, config-reg changes and copy start run, it seems to prevent the applet from running.  Any ideas?  Thanks again for your help. 

Cisco Employee

Re: EEM applet to run on reboot

The countdown timer policy should work in this case.  After the specified number of seconds expire, the policy should execute.  The countdown will start once the startup config has been loaded into the running config.

New Member

Re: EEM applet to run on reboot

Thank you sir!

760
Views
0
Helpful
6
Replies
CreatePlease to create content