Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controling multiple telnet sessions with one active script???

Status
Not open for further replies.

Chris909

Programmer
Jan 27, 2003
12
CA
I am trying to have the script initially activate and connect to 2 or more devices via telnet and then have one running script send commands to any one of the sessions depending on whats required.

It starts the new procomm windows OK but always sends commands to the main procomm window(the first one opened). I have tried all the winactivate, winfocus type commands, I also have the script find the taskid and winid of the new window and set the focus to the this window but commands still go to the main window.

Any help would be greatly appreciated
 
I ran into another person who was having this same problem a few months ago and never came upon a solution. He tried renaming the different sessions using the pwtitlebar command so that he could access each session using the window name, but that did not work either (when he used the different windows commands to access a particular window, he would always be accessing the same session of Procomm). I'll try to mull this over some more this weekend and see if I can come up with a workable idea.
 
I need to get a script to open multiple sessions also, but can't seem to get one script to open multiple windows and log onto different telnet sessions? any help... Chris, I see that you have this working...

Thanks,
Mike
 
Megamike, I have been able to get the script to open multiple procomm windows (use "run" command) but even though the focus is on the new window all aspect commands still go to the first window that started with the script. I have tried every command that is even remotely related to get this working but have had no luck. I am trying to get assistance from the software maker, if I learn anything I will post.
 
Chris,

I got it to work for what I needed by creating a script that runs the login script for each telnet session that I want by running each separate script file. This will initially open a Procomm window to run these scripts, but pwexit closes that window since it is not needed. Here is the example: hope this helps....

proc main

run "grnvl.wax" ; Greenville login
run "nsvl.wax" ; Nashville login
run "jaxfl.wax" ; Jacksonville login

pwexit ; exits first window opened
endproc
 
Once you have your sessions open do you then use a script to talk to these sessions or do you just manually communicate at this point.
What I am trying to do is open at least two sessions and then have one script be able to talk to both sessions depending on the requirement. I have two pieces of equipment that are tied together but are administered independantly. When I make changes in one unit changes must also be done in the second. I thought it would be possible to just drop the telnet connect in the first move to the second connection and then back again. But the units have a security feature that requires you to re-log back in if the connection is lost. I need to continually make changes one after another and this would slow the process to a crawl, so its really not an option.

Well this is interesting anyway:)
 
Chris,

I see what you are needing now, I'm not sure if that is possible. I am using it to monitor Lucent 5ESS Switches and I sometimes need 5 or 6 up at a time. I got tired of manually logging into each one, so I decided to teach myself a little scripting. This has worked beautifully for my application. I will keep yours in mind though, and if I come across something that I think may help you out, I will post it here. Good luck in your quest.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top