Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Old 10-05-2019, 01:38 AM
rlupi001 rlupi001 is offline
Registered User
Join Date: Oct 2019
Posts: 1
Python Scripting trying to clone session more than 9 times


First of all i'd like to thank anyone that can help me with this.

I am running a script that I want to take a list of hosts and run a session into a step server and clone this session multiple times in order to login to each host in my list. However, i find that after 9 cloned tabs my connections seem to not execute properly anymore and just skip each host to the end of the file..

Is there a limit that is going on here that does not let me open and send cmds to more then 9 cloned tabs/windows? Here is my code:
sessionsFileName = os.path.expanduser("~") + "\SessionList.txt"
	if not os.path.exists(sessionsFileName):
			"Session list file not found:\n\n" +
			sessionsFileName + "\n\n" +
			"Create a session list file as described in the description of " +
			"this script code and then run the script again.")

	sessionFile = codecs.open(sessionsFileName, "r", "utf-8")
	sessionsArray = []

	for line in sessionFile:
		session = line.strip()
		if session:	# Don't add empty lines/sessions


	# Connect to each session and issue a few commands, then disconnect.
	Blahship = crt.Session.ConnectInTab("/S Blah-Blah\Blah-Blah")
	Blah2ship = crt.Session.ConnectInTab("/S Blah-CONSOLE\Blah-Blah")
	for session in sessionsArray:
                        #crt.Dialog.MessageBox("Connecting to Session: " + session)
			t = session.split()
			tt = t[0]
			console = t[1]
			if console.startswith("11.2."):
				drone = Blah2ship.Clone()
				drone = Blahship.Clone()
			#drone.Screen.Synchronous = True
			drone.Caption = tt
			drone.Screen.Send("/home/fjordman/dist/inception/inception " + console + "\r")
			drone.Screen.WaitForString("Select a reality: ", 10)
		except ScriptError:
Reply With Quote
Old 10-06-2019, 04:31 PM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,046
Hi rlupi001,

What version of SecureCRT are you using?

Do you get an error when you try to connect to the 10th clone? (If so, what's the error?)

Do you also get this error if you make 10 clones of a tab manually?

If so, then it is likely a limitation imposed by the remote server.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote
Old 10-09-2019, 09:18 AM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,046
Hi rlupi001,

To clarify:
I don't get any error message after the 5th session window is cloned...
Do you get any error message at any time?

Other than having synchronous commented out:

#drone.Screen.Synchronous = True
I don't see anything wrong with the script.

Are you sure the script completes?

Is Cancel available from the Script menu when it stops cloning the sessions?

If not, I would suggest you see if the results are any different in v8.5.4, the current, official release.

VanDyke Software
Technical Support
(505) 332-5730

Last edited by bgagnon; 10-09-2019 at 09:20 AM. Reason: Clarifying inquiry
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 11:22 PM.