I like to present to you my new script that allow to start a external telnet program wait until gets open and then change its window title, resize it to the specified needs from CLI args and after all send a ENTER key into the console to show the device prompt.Back in the days I've try to use "expect", "cmdow" to rename/press that enter to the device, but there is a new option "AutoHotKey" scripting ;))

I'm not so good at selling something and I'll let you decide if can be a option or not :))

Script used to open a telnet program to a GNS3 device Console/AUX1) It will change the Window Title according to the device hostname.2) Also will resize that window as specified in <X_WinSize> <Y_WinSize>Those values are in pixels, recommended 920 420.3) After the telnet connectivity is done, it will push some "Enter" keysuntil the device console from Routers (Dynamips) will show the prompt.This is useful for me because otherwise that router eats one CPU core.

Works great with Telnet, PuTTY, TeraTerm 3.1.3 and SecureCRT 6.7.5other CLI/GUI terminals might work as well, but only those I've tested.

And I also want to ask Jeremy to add a new "Toolbar" in GNS3 in which users can add shortcuts to custom scripts ;))

Script used to close putty windows for GNS3 wrote:

Code:

@ECHO OFF & SETLOCAL

::Script used to close putty windows for GNS3

::I can use TASKKILL to force kill putty, but it will not send the FIN packet to close the TCP connection to::Dynamips and Qemu, and Qemu will not allow to open a new connection after that, and will simply close any new connection::Putty has to be configured for "Default Setings" (in Window->Behaviour->Warn before closing window) to not ask for confirmation when the window is closed!

:INSTALLECHO.&ECHO Installing a new Loopback interface (Takes about 30s)...%DEVCON% install %WINDIR%\inf\netloop.inf *MSLOOPECHO.&ECHO Warning: To make this interface available&ECHO you have to reboot your computer!GOTO :EOF

:ERROR_OLD_OSECHO.ECHO This script is not for Windows 95, 98 or ME.ECHO.PAUSE >NULGOTO :EOF

:ERROR_NOT_ADMINECHO.ECHO This script is not running with sufficient privileges.ECHO.ECHO Under Windows Vista and later Windows versions, you should launch this ECHO script by right-clicking and choosing Run As Administrator.ECHO.PAUSE >NULGOTO :EOF

And I also want to ask Jeremy to add a new "Toolbar" in GNS3 in which users can add shortcuts to custom scripts ;))I think this is an excellent idea. I'll add this to our TODO list :)

Beautiful ;))

grossmj wrote:

I've also 2 questions:- console_wrapper.exe => are there any dependencies?- Loopback NICs manager for Windows - v0.2.1 => Can you detail your changes?Thanks,

In Loopback manager I've changed the way to test the windows version using "VER" and how to test if script has admin privilege by checking a special registry, the rest is the same (just a little syntax cosmetics)

console_wrapper.exe is standalone, no dependencies are needed, it has to be compiled from ".ahk" to ".exe" other ways GNS3 will not run it and users has to have installed AutoHotKey scripting program.The trick is that for SecureCRT users must have a delay between opening the consoles (0.5s), otherwise it will open a new SecureCRT window for each console, even if in command-line is specified to run in tabs. But if SecureCRT was already running everything work great...PuTTY was the ugly one, because it is continuously changing its WinTitle when is minimized/resized, so I had to use registry to make it work, and sometime if there is no delay (0s) between opening consoles and more than 8 consoles are opened in the same time it may put the same name for 2 devices ;)) (because multiple putty processes can start at the same time and read the same value from registry, there is a QOS but...)Telnet will not show the prompt from the first enter and therefore the script checks its output to see a prompt using REG-EX, which works great, but I let this ON only for Dynamips, Qemu host is hard to fit under the same REG-EX - (I don't know if this is global issue, but if I start a router in GNS3 with a good IDLE-PC and I don't press a enter key to show the router prompt, one CPU core stays in 100%, this is the primary reason I've created this script)And those are all known issues.

You may also update the command-line for the rest of tools (SecureCRT+Script, TeraTerm)

console_wrapper.exe is standalone, no dependencies are needed, it has to be compiled from ".ahk" to ".exe" other ways GNS3 will not run it and users has to have installed AutoHotKey scripting program.The trick is that for SecureCRT users must have a delay between opening the consoles (0.5s), otherwise it will open a new SecureCRT window for each console, even if in command-line is specified to run in tabs. But if SecureCRT was already running everything work great...PuTTY was the ugly one, because it is continuously changing its WinTitle when is minimized/resized, so I had to use registry to make it work, and sometime if there is no delay (0s) between opening consoles and more than 8 consoles are opened in the same time it may put the same name for 2 devices ;)) (because multiple putty processes can start at the same time and read the same value from registry, there is a QOS but...)Telnet will not show the prompt from the first enter and therefore the script checks its output to see a prompt using REG-EX, which works great, but I let this ON only for Dynamips, Qemu host is hard to fit under the same REG-EX - (I don't know if this is global issue, but if I start a router in GNS3 with a good IDLE-PC and I don't press a enter key to show the router prompt, one CPU core stays in 100%, this is the primary reason I've created this script)And those are all known issues.

Excellent, I'll see if I can ship console_wrapper.exe in the next GNS3 release and propose preconfigured lines in Console Preferences.

Quote:

You may also update the command-line for the rest of tools (SecureCRT+Script, TeraTerm)

Anyway, there should be also a custom option as well. So users with another telnet program can use there own preferred tool.Also PuTTY/SecureCRT/TeraTerm can be installed in ex: "F:\whatever\...\TeraTerm_john_smith.exe" ;)), so if GNS3 is preconfigured to point to "%ProgramFiles%" or "%ProgramFiles(x86)%" will be impossible for users to have a 100% portable version of GNS3 (Memory Stick/External HDD).This is the reason why I've asked you to add a command line option for GNS3.exe to load its configuration file form a different location other than "%APPDATA%\gns3.ini" (C:\Users\User\AppData\Roaming\gns3.ini)

TeraTerm works great with this script, it is fully supported, but it can also be started by that command line to accomplish all needs, except the "press the enter key part". TeraTerm supports the "remote WinTitle change" feature like Putty, so it will change again its title when is connected to Dynamips. (my script change it back again ;))SecureCRT is the only one that can do all by it self, by using the new VBScript+Command line (the script fully support it)

grossmj wrote:

Do all others require console_wrapper.exe? (if I changed the default line)

What do you mean others? Any other telnet programs?Probably some programs will have a strange command line to start them. This script will start all unknown (other than Telnet, PuTTY, TeraTerm or SecureCRT) tools as "program.exe IP PORT"

grossmj wrote:

Excellent, I'll see if I can ship console_wrapper.exe in the next GNS3 release

Well, then this is a great news ;)I can do some other tricks with those windows (Thanks to AHK):* Set window always-on-top* Start minimized/maximized* Bring to front (Activate the window)* Window size (Already supported)* Windows in tabs (I'll try to see if can be done, to make PuTTY/Telnet/Etc look like SecureCRT) * Support more Telnet tools (even GUI, not only command-line)* Show/Hide script icon in system tray while starting a telnet program. After that it close it self* Any other stuff that can be useful

Known issue:Sometimes if you have a 64bit OS (GNS3 is 64bit) and use the 32bit version of this script, it may say that "telnet_program.exe" does not exist, but in reality it is there.This is a false positive scenario and is solved by downloading\compiling the script (.ahk) as 64bit (This strange bug comes from Microsoft x86->x64 path translations)I found it with "telnet" (C:\Windows\System32\telnet.exe)

No, I thanks you for this great tool!Well, I've send 2 mails to those guys (PuTTY devs - <putty(a)projects.tartarus.org>) regarding this issue and never receive a feedback, but if you feel more lucky, give it a try ;)

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum