VKontakte.DJ
forum traveling
 

Celestial Software

...better by design

Home Support SSH Client Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Sending command to multiple tabs (1 viewing) (1) Guest
Go to bottom Favoured: 0
TOPIC: Sending command to multiple tabs
#2560
Sending command to multiple tabs 10 Years, 1 Month ago  
Is there a way to send a command to multiple tabs using Absolute Telnet?

For example let say I have 30 tabs opened, each tab is a different server. I need to poweroff the servers and I want to do this by sending the command to all servers at the same time.

Is there a way to do this with Absolute Telnet?
31special (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
Logged Logged  
 
The administrator has disabled public write access.  
#2561
Re:Sending command to multiple tabs 10 Years, 1 Month ago  
This sounds like a job for scripting, but currently scripts only run within the context of the tab they are run in. There is no way for a script to issue commands to other tabs.

You could try the following:

1. Write a script that connects to each server and issues the shutdown command, then disconnects. Do this in a loop and loop through a list of servers. THis would all execute within a single script in a single tab.

2. AbsoluteTelnet/SSH *does* have the ability to run as an ActiveX control, however. You could write a C# program that uses Absolute to connect to each server, issue the shutdown, etc...

Need more help?

Brian
bpence (Admin)
Admin
Posts: 1343
graph
User Offline Click here to see the profile of this user
Logged Logged  
 
Brian Pence
Celestial Software
SSH , SFTP, and Telnet in a tabbed interface for Windows XP, Vista, Mobile, and others
 
The administrator has disabled public write access.  
#2562
Re:Sending command to multiple tabs 10 Years, 1 Month ago  
The script could look something like this. I created a file called c:serverslist.txt that contains a lis of servers you'd want to affect. This script reads through the list, connects to the server and issues a shutdown command. Your script may vary, depending on the connection type, login sequence, etc... But you should get an idea from here how it could be done.

This code can be implemented as an on-demand script using the key-mapping feature. The keyword VBSCRIPT at the beginning tells the key mapper to execute the following text as a script when the given key is pressed. Key mapping functionality can be found on the Options->Properties->VTOPtions page.

Code:


VBSCRIPT
  DIM objFSO, objFile, serverName, portNumber, userName, password, retval, timeout
sub MAIN
  Print "running"+vbNewLine
   set objFSO = CreateObject("Scripting.FileSystemObject")   
    set objFile = objFSO.OpenTextFile("c:serverslist.txt",1) 
   Do until objFile.AtEndOfStream
     serverName =  objFile.ReadLine
     portNumber =  objFile.ReadLine
     userName =  objFile.ReadLine
     password =  objFile.ReadLine
     timeout = objFile.Readline

      Print "Shutting down: " + serverName + vbNewLine

     Terminal.SetConnectionType "ssh2"
     Terminal.SetConnectionHost serverName 
     Terminal.SetConnectionPort portNumber
     Terminal.SetSSHUsername userName
     Terminal.SetSSHPassword password


     retval = Terminal.Connect ( timeout )

    if(retval) then
       Terminal.WaitForTimeout  "~$", 10000 
       Terminal.Print("Connected")
       Terminal.SendText "sudo shutdown -r now" +vbNewLine
       Terminal.WaitForTimeout "password", 10000
       Terminal.SendText password+vbNewLine
       Terminal.WaitForTimeout "The system is going down"
       Terminal.Disconnect
    else
       Terminal.Print("Not Connected")
    end if
      
   Loop  
  objFile.Close
  Print "done"+vbNewLine
end sub

bpence (Admin)
Admin
Posts: 1343
graph
User Offline Click here to see the profile of this user
Logged Logged  
 
Last Edit: 2010/10/28 13:20 By bpence.
 
Brian Pence
Celestial Software
SSH , SFTP, and Telnet in a tabbed interface for Windows XP, Vista, Mobile, and others
 
The administrator has disabled public write access.  
Go to top