02-17-2014 12:24 PM
I am working on a script that will make interface changes. I am trying to do the following:
1) save the output from the following command: #show cdp nei detail | i Interface
2) this will most likely give a list of interfaces some of which will be repeated. If the interface is listed more than once then i would like to remove the
repeated interface. (note i am not concerned about the outgoing interface)
3)using the above information i would then like to make configuration to the interfaces with the following commands
#config t
#interface $intf
#no mls qos vlan-based
#mls qos trust dscp
i have started this script (please see attached file) and would really appreciate some assistance especially with how to eliminate multiple instances of the same interface.
thanks!!
02-17-2014 01:26 PM
Add "set summary [lsort -unique $summary] " to your script after creating $summary.
if [catch {cli_exec $cli1(fd) "show cdp neighbors detail | include Interface" } summary ] {
error $summary $errorInfo
}
set summary [lsort -unique $summary]
set lines [split $summary "\n"]
ect....
Dan
03-07-2014 09:14 AM
I am having issues running scripts on my 3750x. One of the few commands i am getting to work is the
router(tcl)#puts "testing this command"
most all other commands are not working for example: ios_config, set
I am attaching a file with more details. Any help would be greatly appreciated!
03-08-2014 01:29 PM
Tclsh doesn't work with command authorization. If you need to use command authz, you will need to switch to EEM Tcl and configure:
event manager session cli username USER
Where USER is a user authorized to run all of the CLI commands. Since this thread doesn't seem to be applicable to what you're doing, I recommend you start a new one if you require more help.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide