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 08-09-2017, 01:09 PM
stevenjwilliams stevenjwilliams is offline
Registered User
 
Join Date: Aug 2017
Posts: 4
Importing Sessions with different Port Numbers

I am running into an issue where the script to import sessions from csv is failing on line 510. I think its because when it sees protocol Telnet it wants to set the port to 23, But i have a need to set different port numbers per session, heres what I have in my csv:

folder,hostname,port,protocol,session_name
__UNETLAB_EVE_NG,10.100.27.15,32769,Telnet,R01 - 32769
__UNETLAB_EVE_NG,10.100.27.16,32770,Telnet,R02 - 32770
__UNETLAB_EVE_NG,10.100.27.17,32771,Telnet,R03 - 32771
__UNETLAB_EVE_NG,10.100.27.18,32772,Telnet,R04 - 32772
__UNETLAB_EVE_NG,10.100.27.19,32773,Telnet,R05 - 32773
__UNETLAB_EVE_NG,10.100.27.20,32774,Telnet,R06 - 32774
__UNETLAB_EVE_NG,10.100.27.21,32775,Telnet,R07 - 32775

As you can see i need to connect to the same host, just different port numbers.

Is this possible?
Reply With Quote
  #2  
Old 08-09-2017, 01:36 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,382
Hi stevenjwilliams,

I believe we have an email thread together. You are using the Import Arbitrary Data From File to SecureCRT Sessions example script from here, correct?

Your example source data does not show different IP addresses, but if you are using the same host but different ports it should not matter.

Please post a screenshot of the exact error message you are getting.

If your forum account status prevents attachments, please send an email to support@vandyke.com and reference "Attn Brenda - Forum Thread #12770" in the subject line.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 08-09-2017, 02:08 PM
stevenjwilliams stevenjwilliams is offline
Registered User
 
Join Date: Aug 2017
Posts: 4
I am using that script you mentioned. It is the same host, just different ports per session.
Attached Images
File Type: png Capture1.PNG (8.6 KB, 14 views)
Reply With Quote
  #4  
Old 08-09-2017, 02:12 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,382
Hi stevenjwilliams,

It turns out that the max integer value (in VBScript) for CInt is 32768. So there are three places in that script you will probably need to replace CInt with CLng (lines 500-511).

Code:
                If UCase(strProtocol) = "SSH2" Then
                    If strPort = "" Then strPort = 22
                    objConfig.SetOption "[SSH2] Port", CLng(strPort)
                End If
                If UCase(strProtocol) = "SSH1" Then
                    If strPort = "" Then strPort = 22
                    objConfig.SetOption "[SSH1] Port", CLng(strPort)
                End If
                If UCase(strProtocol) = "TELNET" Then
                    If strPort = "" Then strPort = 23
                    objConfig.SetOption "Port", CLng(strPort)
                End If
We will get the example script in the forums updated shortly as well. Thanks for finding that flaw in the script.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 08-09-2017, 02:14 PM
stevenjwilliams stevenjwilliams is offline
Registered User
 
Join Date: Aug 2017
Posts: 4
Just glad its an easy fix.

Thanks for the help.
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 06:51 PM.