View Single Post
  #1  
Old 02-18-2021, 01:46 PM
SeanL SeanL is offline
Registered User
 
Join Date: Nov 2020
Posts: 2
Launch New Sessions from host list

Looking for a script or built in function that lets me launch a large number of sessions (10-100) at once. Ideally it would just use the same default session settings.

With the upgrade 9.0 today allowing python 3 i'm wondering if anyone has any ideas?

I've been using one for a while but it's a bit annoying to setup:
Code:
# $language = "python"
# $interface = "1.0"

# Connect to an SSH server using the SSH2 protocol. Specify the
# username and password and hostname on the command line as well as
# some SSH2 protocol specific options.


def main():
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 4494R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 4495R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 4499R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6401R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6402R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6403R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6404R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6405R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6406R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6408R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6409R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6411R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6413R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6416R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 1534R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 1546R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 1570R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 1586R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 1608R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 1638R")
	crt.Session.ConnectInTab ("/SSH2 /AcceptHostKeys /L myUSERNAME /PASSWORD THISisAsecretPASWORD|THISisAsecretPASWORD 6439R")


		
main()

Ideally I'd like to be able to QUICKLY loop through a list of hostnames and launch a session for it.
Right now my script has to be manually edited with the new hostnames or IPs and it only starts launching the next session after about 3-5 seconds since launching the last one.


In the end I'll use the command window to send the same set of commands to all devices.

Any ideas would be much appreciated, thank you!
Reply With Quote