08-11-2010 08:11 PM
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.
Solved! Go to Solution.
08-16-2010 09:19 AM
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.
08-11-2010 11:43 PM
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
08-13-2010 12:30 AM
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.
08-14-2010 05:05 PM
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"
...
08-16-2010 07:32 AM
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.
08-16-2010 09:19 AM
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.
08-24-2010 10:14 AM
Thank you sir!
05-07-2020 06:12 AM
03-15-2022 03:36 AM
I'm trying to achieve something similar, but what I'm looking to do is keep all interfaces shutdown on a 3548 for two minutes after reboot. Any thoughts how I can go about this?
03-15-2022 04:24 AM
Hello,
what state are the interfaces in on reboot, shut, or no shut ?
03-15-2022 04:46 AM
In steady state, interfaces will be in no-shut or enabled stated. However I wanted to keep interfaces down for two minutes after the reboot till it's processors are up and stable.
03-15-2022 05:54 AM
Hello,
you could use a wait timer:
event manager applet on-reboot
event timer cron cron-entry "@reboot"
action 1.0 cli command "enable"
action 2.0 cli command "configure terminal"
action 3.0 cli command "interface range G0/0 - 48"
action 4.0 cli command "shut"
action 5.0 wait 120
action 6.0 cli command "no shut"
action 7.0 cli command "end"
03-15-2022 06:18 AM
Thanks @Georg Pauwen, however "timer" is not an option available. I've only got
cli
counter
fanabsent
fanbad
fib
gold
internal-link-flap
memory
module
module-failure
neighbor-discovery
oir
policy-default
poweroverbudget
snmp
storm-control
syslog
sysmgr
tag
temperature
test
track
No timer option under event.
03-15-2022 06:23 AM
Hello,
could be your EEM version, or your platform. Try the syslog instead:
event manager applet REBOOT
event syslog pattern "SYS-5-RESTART"
action 1.0 cli command "enable"
action 2.0 cli command "configure terminal"
action 3.0 cli command "interface range G0/0 - 48"
action 4.0 cli command "shut"
action 5.0 wait 120
action 6.0 cli command "no shut"
action 7.0 cli command "end"
03-15-2022 06:34 AM
I believe it is to do with Nexus 3K EEM version, unfortunately "wait" is not an available option either. I'm thinking of calling a python script to get this done.
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