Remote execution of Cisco IOS commands through console server in Tcl script
Could you please help me in the following:
There is a router with NM-32A, which serves as a console server for a number of Cisco routers and switches. When some network diagram has been assembled using some of them, and the neccessary devices are turned on, i would like some Tcl script to run through them all, configure their hostnames, turn on their corresponding interfaces, execute "show cdp neighbors" command, save the output into tcl list variables (one for each device in the scheme), search through each list variable and figure out whether the devices are connected as needed, i.e. according to diagram, whether corresponding interfaces are OK and so on. Is this possible? Here I don't ask you for exact tcl script, rather the question is principal - possible or not, as well as direction of research?
I think tcl script must be on console server, and there it is executed, starting to configure the devices in the scheme etc.
Partial problem #1
I've mastered how to send some responses ahead of the Cisco IOS commands in tcl script, e.g.
typeahead "y"; exec "clear line xx"
But I've faced with difficulty like this: when I use
exec "telnet x.x.x.x 20xx" set CDPList [exec "show cdp neighbors"] send [binary format c 0x1E]x typeahead "y"; exec "clear line xx"
the console hangs with no output after exec "telnet x.x.x.x 20xx" tcl string, so I need to clear that line from other vty session to the same console server.
The question here is how one could execute commands remotely, when in reverse telnet session, through tcl script? Should I use typeahead directive with all the commands for execution on the target device before the exec "telnet x.x.x.x 20xx" command?
Partial problem #2
How tcl string looks like that returns to console server from reverse telnet session? How to send <CTRL-Shift-6 x> sequence once in tclsh when the srcript is currently in reverse telnet session?
We are pleased to announce availability of Beta software for 16.6.3.
16.6.3 will be the second rebuild on the 16.6 release train targeted
towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are
looking for early feedback from customers befor...
Introduction Featured Speakers Luis Espejel is the Telecommunications
Manager of IENova, an Oil & Gas company. Currently he works with Cisco
IOS® and Cisco IOS XE platforms, and NX to some extent. He has also
worked as a Senior Engineer with the Routing P...
In this session you can learn more about Layer 3 multicast and the best
practices to identify possible threats and take security measures. It
provides an overview of basic multicast, the best security practices for
use of this technology, and recommendati...