cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
685
Views
0
Helpful
3
Replies

TCL Script

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

thanks

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

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

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

Thanks

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: