Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-27-2017, 12:54 PM
SimonHF SimonHF is offline
Registered User
 
Join Date: Sep 2005
Posts: 42
Cross platform scripting?

Unfortunately it is not an option for me to use SecureCRT on Windows. Instead I use it on OSX. I notice that most of the scripting examples run on Windows.

Is there a web page / info somewhere which describes which scripting functionality works on which OS platform? If my wish came true then Perl would be possible on OSX... :-)
Reply With Quote
  #2  
Old 10-27-2017, 01:18 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,293
Hi SimonHF,

What are you trying to accomplish?

You can use Python on Mac OS and we do have some Python examples. You might just try using the script recorder in SecureCRT (Script menu / Start/Stop Recording Script).

I have added this thread to a feature request in our product enhancement database to add scripting support for Perl (Mac, Linux). Should a future release of SecureCRT include this feature, notification will be posted here.

If you prefer direct email notification, send an email to support@vandyke.com and include "Feature Request - Forum Thread #12879" in the subject line or use this form from the support page of our website.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 10-27-2017, 06:11 PM
SimonHF SimonHF is offline
Registered User
 
Join Date: Sep 2005
Posts: 42
Hi Brenda,

Thanks for the quick response.

One thing which attracted me to the script facility is the ability to log in on many boxes. I work with Amazon EC2 a lot and the number of boxes and IPs change all the time. It's relatively easy to get a list of e.g. 100 IPs of similar boxes but difficult to then manually log in on each box. If I could script logging in and hand the script the 100 IPs then this would be very useful for me. You say Python is the only scripting language available for OSX. Do you happen to have an example Python script which will log in on n boxes given a list of IPs?

Thanks,
Simon
Reply With Quote
  #4  
Old 10-28-2017, 07:34 AM
GJB56 GJB56 is offline
Registered User
 
Join Date: Nov 2011
Posts: 22
I found this on the forum a while ago and it is a timesaver. Get a list of IPs from the clipboard and store into an array. Then your script can just loop through the array and connect to each host.

Code:
Sub Get_Hosts_From_Clipboard()
' Start of with a reasonable size for the array
	ReDim vSessionsArray(64)
	strClip = crt.Clipboard.Text
' Split up the selected text into separate lines. ' First, let's standardize the text by making sure ' each line is separated by only a carriage return.
	strClip = Replace(strClip, vbcrlf, vbcr)
	strClip = Replace(strClip, vblf, vbcr)
' Now, use Split() to create an array out of each of the lines.
	vSessionsArray = Split(strClip, vbcr)
' Remove leading and trailing spaces
	For Each strSession In vSessionsArray
		strSession = Trim(strSession)
	Next
End Sub
Reply With Quote
  #5  
Old 10-30-2017, 07:02 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,293
Hi Simon,

GJB56's example does illustrate the concept, but is VBScript unfortunately.

Is your goal to create sessions? Or do you just want to make ad hoc connections?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #6  
Old 10-30-2017, 10:27 AM
SimonHF SimonHF is offline
Registered User
 
Join Date: Sep 2005
Posts: 42
From time to time I've found it necessary to run a command on a larger number of boxes which tend to have an ever changing list of IPs or names making it impossible to save the login in SecureCRT. The largest group I've tried so far is ssh'ing into 63 boxes. However, this is significant keyboard and mouse time in the SecureCRT GUI just to log on to all of them. Finally once connected then I can send a command to all of them concurrent and see the results in each GUI tab. What I'm looking for is a way to automated the connection process. And secondly, 63 tabs still works in SecureCRT, but what if I wanted to do the some thing with e.g. 630 IPs? Presumably the GUI would bork at handling 630 tabs?

So I'd love to have a script on Linux allowing me to connect to many boxes. Or better a feature in SecureCRT where I can just past multiple IPs in the connect host dialog field. But going forwards I'm wondering what the limits are regarding the number of hosts which can be connected to and what good strategies are for automating ssh commands to very many hosts?
Reply With Quote
Reply


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 01:59 AM.