Execute multiple commands at once
Sometimes you'd like to automate execution of command sequences or create a command alias that would trigger a series of commands. One way of achieving this is by creating an EEM applet. For example, to clear IP routing table and reset BGP neighbors, define the following EEM applet:
Note: this article is part of You've asked for it series.
event manager applet ClearAllYou can trigger this applet with the event manager run ClearAll command or you could configure a command alias, for example alias exec cleanup event manager run ClearAll.
event none
action 1.0 cli command "clear ip route *"
action 2.0 cli command "clear ip bgp *"
Note: this article is part of You've asked for it series.
like e.g reload
[confirm] ENTER
how to confirm command in the tcl script ?
I configured the following applet:
event manager applet DebugSIP
event none
action 1.0 cli command "debug ccsip messages"
action 2.0 cli command "terminal monitor"
!
I run it with:# event manager run DebugSIP
Yet I don't get any messages on the terminal..
Any idea why?
Thanks again,
Gabriel
A tcl script executed with tcl command might do the trick (don't remember the details, it's been a long time). Yet again, I probably published at least one example of how that's done.
puts [open "flash:debugSIPon" w+] {
exec "debug ccsip messages"
exec "terminal monitor"
}
when I execute it
tclsh flash:debugSIPon
I don't get any error, but no output to vty either.
Thanks
http://wiki.nil.com/Executing_IOS_commands_from_Tcl_shell
Thanks for your quick response!!