08-23-2011 02:53 AM
Hi guys,
I have an issue with an EEM script where one of the applets is aborting. The script runs when a track drops (this is tracking ip routing an a dialer interface). The result of this applet is to reload a router when the track drops, providing that a "reload" variable is false.
Config below:
event manager session cli username "embedded"
username embedded privilege 15
event manager applet RESTARTED
event syslog pattern "SYS-5-RESTART"
action 1.0 set reloaded "TRUE"
action 2.0 syslog msg "ATTENTION: THIS ROUTER HAS BEEN AUTOMATICALLY RELOADED I
N AN ATTEMPT TO RESYNC THE DSL CCT"
action 3.0 context save key RELOADED variable "reloaded"
event manager applet DWNBT
event track 100 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no kron occurrence MONITOR in 6:00"
action 4.0 context retrieve key RELOADED variable "reloaded"
action 5.0 if $reloaded eq TRUE
action 6.0 syslog msg "ATTENTION:THE AUTOMATICALLY INITIATED RELOAD HAS FAILED
TO RECTIFY THE ISSUE"
action 7.0 context save key RELOADED variable "reloaded"
action 8.0 else
action 8.5 cli command "end"
action 9.0 cli command "sh clock | append nvram:DSLdown.txt"
action 9.5 reload
action 9.6 end
event manager applet RESTORED
event track 100 state up
action 1.0 context retrieve key RELOADED variable "reloaded"
action 2.0 cli command "enable"
action 3.0 cli command "conf t"
action 4.0 cli command "kron occurrence MONITOR in 6:00 oneshot"
action 5.0 cli command "policy-list MONITOR"
action 6.0 syslog msg "ATTENTION:THE CCT HAS RESTORED"
action 7.0 context save key RELOADED variable "reloaded"
event manager applet RESET
event none
action 1.0 context retrieve key RELOADED variable "reloaded"
action 2.0 set reloaded "FALSE"
action 3.0 context save key RELOADED variable "reloaded"
kron policy-list MONITOR
cli en
cli event manager run RESET
###########################################################################################################################
As the another app (specifically RESTORED) is running successfully after DWNBT, I know that the variable exists (is there a way of viewing the variable???).
Below is the event history showing that the apps are running, but the app that should reload the router is aborting:
#sh event manager h e
No. Job Id Proc Status Time of Event Event Type Name
1 2 Actv success Thu Aug11 22:39:23 2011 track applet: RESTORED
2 3 Actv success Fri Aug12 04:41:10 2011 none applet: RESET
3 4 Actv abort Tue Aug16 23:45:36 2011 track applet: DWNBT
4 5 Actv success Wed Aug17 00:08:33 2011 track applet: RESTORED
5 6 Actv abort Wed Aug17 02:03:10 2011 track applet: DWNBT
6 7 Actv success Wed Aug17 02:34:12 2011 track applet: RESTORED
7 8 Actv success Wed Aug17 08:34:15 2011 none applet: RESET
8 9 Actv abort Tue Aug23 01:04:25 2011 track applet: DWNBT
9 10 Actv success Tue Aug23 01:21:50 2011 track applet: RESTORED
10 11 Actv success Tue Aug23 07:21:55 2011 none applet: RESET
I have enabled debug event manager action cli to see if this throws up any reason for the abort.
Can anyone see a reason for this in my config? I have tested this in the lab and it worked, but now I've deployed this, I'm getting the abort issue. I am seeing this same issue on another router running the same config.
Router - 877
IOS - 12.4(22)T5 Advanced IP Services
Thanks everyone.
Solved! Go to Solution.
08-27-2011 10:31 AM
Sure. Just add a "maxrun" option to the end of the event registration line. For example:
event track 100 state down maxrun 60
08-24-2011 12:57 AM
What does the debug show? If the applet is taking longer than 20 seconds, it will abort.
08-26-2011 03:28 AM
Hi Joseph,
these routers are in a production environment, so I am waiting for the next time the DSL link drops and causes the applet to run.
Once I get the output, I'l post it.
Is there any way to amend the timeout period of the applet?
Thanks
Scott
08-27-2011 10:31 AM
Sure. Just add a "maxrun" option to the end of the event registration line. For example:
event track 100 state down maxrun 60
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