Search this Blog

Thursday, April 4, 2013

EEM configuration for a TCL script dissapear from config if it is an "abort"

FridayWe loaded 4 TCL scripts to the router. We configured EEM to execute the TCL scripts with kron event trigger.


The EEM launched the 4 scripts...
3    3      Actv success  Sat Feb23 09:00:00 2013  timer cron         applet: 1-refresh
4    4      Actv success  Sat Feb23 09:52:00 2013  timer cron         applet: 2-refresh
5    5      Actv abort    Sat Feb23 09:55:00 2013  timer cron         applet: 3-refresh
6    6      Actv abort    Sat Feb23 09:58:00 2013  timer cron         applet: 4-refresh

The EEM code for the scripts that failed was removed by system from running-config at this time without human intervention.

EEM only executes the "success" scripts becuase there is no more code for anything else:
7    7      Actv success  Sun Feb24 09:00:00 2013  timer cron         applet: 1-refresh
8    8      Actv success  Sun Feb24 09:52:00 2013  timer cron         applet: 2-refresh


We reviewed the running-config:
Router#sh run | i event manager
event manager applet 1-refresh
event manager applet 2-refresh

No more applets in the running-config.
IOS with this issue is: c7200p-advipservicesk9-mz.151-4.M6.bin (it also happens in M5)

All scripts works fine with c7200p-advipservicesk9-mz.152-4.M2.bin for several days.

Re-enter the missing code in 151-4.M6 (also M5) in the running config doesn't fix the issue, it is happening again.

Is this the expected behaviour of 15.1-4M train?

The EEM Tcl code has the header on it to run directly out of EEM.  You can simply the code by using the built-in HTTP API provided in EEM Tcl.  Using tclsh is fine if you are only using tclsh.  When you need to use EEM to schedule or automate code, you shouldn't wrap tclsh within EEM.  Instead, use EEM Tcl.

If the config is modified now, hopefully things will be simpler and easy to debug using the single Tcl policy.  Tcl hasn't had any "major" changes since it was introduced in 12.3(2)T.

The abort is typically caused by an expiration of the maxrun timer.  However, I don't see a debug for an abort.  I don't know what your Tcl script is doing, but perhaps it needs longer than 300 seconds to do it.  That said, what you are doing is not recommended.  You should not call tclsh our of applets.  Instead, port your tclsh script to EEM Tcl.  Depending on what the script does it may be very easy to do that.

Citation - This blog post does not reflect original content from the author. Rather it summarizes content that are relevant to the topic from different sources in the web. The sources might include any online discussion boards, forums, websites and others.

No comments :

Post a Comment

/* Google Analytics begin ----------------------------------------------- */ /* Google Analytics end ----------------------------------------------- */