TCL Script

Unanswered Question
Sep 2nd, 2010
User Badges:

Greeting all

Does anyone have a TCL script that will execute a bunch of command , in other word the same as even manager with the event none (i don`t have the license for ip service to have EEM so i`m looking for a script that u can tell him in just one line to execute a bunch of CLI command


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Joe Clarke Thu, 09/02/2010 - 22:37
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

This is very easy to do in tclsh.  Here's an example:

set output [exec "show version"]

append output [exec "show ip int brie"]

append output [exec "show proc cpu"]

puts $output

Seifeddine-Tlili Fri, 09/03/2010 - 05:42
User Badges:

Hi Joseph thanks for your reply i really appeciate it

So basically if i`d like to replace these commands:

event manager applet ShutDown
event none
action 1.0 cli command "en"
action 2.0 cli command "conf t "
action 3.0 cli command "int range fas 1/0/1-12"
action 4.0 cli command "description Event Working"
event manager applet RUN
action 1.0 cli command "EEM"

alias exec EEM event manager run ShutDown

i`ll have to create a scritp with the following lines

First one DESCRIPTION.tcl

set output [exec "en"}

append output [configure "int range fas1/0/1-12"]

append output [interface "description Event Working"]

then using kron i`ll invoque the scrit periodically using the command tclsh DESCITION.tcl

Is that correct ...sorry but i`m really not confortable with scripting


Joe Clarke Fri, 09/03/2010 - 23:49
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

You want:

ios_config "int range fas 1/0/1-12" "description Event Working" "end"

That's all the tclsh script you'd need for your EEM applet.


This Discussion