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 01-26-2018, 12:32 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
Automation of Sesion creation

Is it possible to create a new saved session from within a script?
Also Create a firewall?
These two things would allow me to automate the entire setup for other users of my script.
The Firewalls I think are my biggest stumbling block right now.
__________________
Version 6.7.3 (build 292)
Reply With Quote
  #2  
Old 01-26-2018, 01:05 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi bstedh,

Quote:
Is it possible to create a new saved session from within a script?
Absolutely, the link below is to an example script that imports session information from a file and creates saved sessions. This should be a good "jumping off" point that demonstrates the requirements.
https://forums.vandyke.com/showpost....89&postcount=1
Quote:
Also Create a firewall?
Are you needing to create a firewall or simply assign an existing firewall to the sessions you create? If you need to assign a firewall, are you using Dependent Sessions, is the firewall a saved session?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 01-26-2018, 02:01 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
Ok I got the creation of new sessions down and it was much easier than I though even though I don't have V7.

Code:
Set cfg = crt.OpenSessionConfiguration("Default")
cfg.Save "TestME"
Set cfg = crt.OpenSessionConfiguration("TestME")
Then set the individual items with cfg.SetOption.

For "Firewall" I need to create a firewall under global config to use for connecting to devices through port forwarding through the jumbox connection under the cfg.SetOption "Firewall Name", "Forward". I would have to create the "Forward" Firewall to match the port forwarding in the jumbox session.

This is where most get lost when setting up their secure CRT.
__________________
Version 6.7.3 (build 292)
Reply With Quote
  #4  
Old 01-26-2018, 02:23 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi bstedh,

There is not currently a scripted method available to create a firewall as if going through Options > Global Options > Firewall.

I have recorded your idea in our database of SecureCRT feature requests so that the product director can evaluate it for possible inclusion in a future release.

Should a version of SecureCRT become available with this feature, we will be sure to let you know.

That being said there may be other options. One option that may work for you would be to use SecureCRT's Dependent Sessions feature to manage connections through a jump host. The use of this feature does require that your jump host allow port forwarding but does make the process of connecting through a jump host much easier.

The general steps to set this up are:

1) Create and save a session going to your jump host
2) Create and save a session as if you were going directly to
the end device.
3) Right click on the end device session and choose properties,
then navigate to the SSH2 category of Session Options.
4) In the Firewall drop down menu choose Select Session and
select the session you saved for the jump host.

After configuring SecureCRT this way you should be able to simply double click on the end device session and SecureCRT will automatically connect to and route data through the jump host.

As an example you could script the creation of a Firewall Session, named "Forward", then use something like the below when creating the rest of your sessions.

Code:
cfg.SetOption "Firewall Name", "Session:Forward"
Does this seem like an option that would work for you?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 01-26-2018, 02:31 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
I will give it a try.
__________________
Version 6.7.3 (build 292)
Reply With Quote
  #6  
Old 01-26-2018, 02:42 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
I don't think that is an option in V6.7.3 I get an error that that firewall was not found in the database.
__________________
Version 6.7.3 (build 292)
Reply With Quote
  #7  
Old 01-26-2018, 02:53 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi bstedh,

V6.7.3 is an older version, released over 6 years ago, Dependent Sessions are not available with that version.

Changes in SecureCRT 7.1 (Beta 1) -- February 26, 2013 (7.1.0.195)
------------------------------------------------------
New features:

- Added support for dependent sessions so that a connection can
be made to a jump host or SSH gateway before the session is
connected.

If you would like to send in your license data via email I would be happy to see if your license qualifies for a newer version or upgrade. PLEASE DO NOT POST LICENSE INFORMATION IN THE FORUMS, instead please send an email to Support@VanDyke.com with "Attn Eric Forum post 12990" in the subject line.

What is the serial number associated with your license registration?

Typically, the "Serial Number" -- not to be confused with the longer "License Key" -- can be seen from the "About" window that is reached by choosing "About ..." from the main "Help" pull-down menu if you're on Windows, or from the main application menu if you're on Mac.
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #8  
Old 01-26-2018, 03:32 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
Unfortunately we have to go through IT for any software upgrades. Not going any where near that mess. They are very strict with licensed software and approved versions, unlike other companies I have worked for. Which in the long run is good for you guys. But it slows adoption of new versions greatly.

So far the only config the users of my script need to make now is one firewall entry and everything works. That is way better than what they had to do previously so It is a big plus and will increase the number of techs that will use it.
__________________
Version 6.7.3 (build 292)
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 12:27 AM.