cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
535
Views
0
Helpful
1
Replies

kron spawning TCL script problem on Catalyst 2960S IOS 15.0(2)SE lanbase

AndersAberg
Level 1
Level 1

I originally posted this question in the Network Management section, but as I got no replies I give it a try here too as it concerns Catalyst switches:

I have developed a TCL script, which I want to run automatically every night. Its purpose is to identify all ports on a switch, which have been manually reconfigured for testing purposes etc and reconfigure them according to a defined standard (which enforces 802.1X authentication on each port etc). The script itself works flawlessly if I run it manually from tclsh, but when I schedule execution from kron, script execution stops half-way through since kron appears to think it is dealing with a "Runaway Process".

Googling has revealed a few things:

  1. Spawning TCL scripts from kron did not work prior to IOS 12.4(3) - the Catalyst 2960S I am working with is on 15.0(2)SE.
  2. If kron believes the TCL script is interactive, it will fail. My script is not interactive (it does produce som output on stdout, but expects no input during execution).
  3. I ought to use an EEM policy instead of kron. Good suggestion, but I don't have any "event" commands on my platform - so I'm stuck with kron!

This is what "debug kron all" results in:

May 27 23:06:00.488: Major 1, Minor 0
May 27 23:06:00.488: Timer Event test
May 27 23:06:00.488: Call parse_cmd 'tclsh tftp://<scrubbed>/nightly.tcl'
May 27 23:06:16.605: %SYS-5-USERLOG_NOTICE: Message from tty2(user id: ): nightly.tcl executing
May 27 23:06:16.663: %SYS-5-USERLOG_NOTICE: Message from tty2(user id: ): autoReset Fa1/0/40: spawning pset to reconfigure interface as 802.1X end user port
May 27 23:06:16.925: Major 4, Minor 8
May 27 23:06:16.925: Signaled from Runaway Process
May 27 23:06:16.925: Forcing Removing Policy nightly
May 27 23:06:16.925: Removing Policy nightly
May 27 23:06:16.925:     Removing CLI 'tclsh tftp://<scrubbed>/nightly.tcl'
May 27 23:06:16.925: Done Removing Policy nightly
May 27 23:06:16.925: Forcing Removing Occur test
May 27 23:06:16.925: Removing Occur test
May 27 23:06:16.925:     Removing Policy Name 'nightly'
May 27 23:06:16.925: Finished Removing Occurrence test

The TCL script was expected to identify one port on my 48-port switch, which needs to be reconfigured, then remove all existing port config and add some 20 lines of new configuration to the port. After execution by kron, only 10 of the expected configuration lines have been added to the interface in question, then execution of the TCL script seems to have abruptely stopped.

If I run the very same script manually with "tclsh tftp://<scrubbed>/nightly.tcl" all configuration lines are applied correctly to the interface.

Any ideas? Is this a known problem also in 15.0(2)SE? Any help would be appreciated.

Cheers,
Anders Aberg

1 Reply 1

despite 2 year later, I have the same problem, but different TCL script.

No interactive action in my script, just some output to the local syslog.

My script stucks while looping through the contents of a text-file(read via http).

Output from debug kron all" is the same.

The 2960S is on 15.0(2)SE2. The script is to update automatically outdated IOS versions.

 

Kind regards,

Andreas

Review Cisco Networking for a $25 gift card