Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 07-19-2012, 10:54 AM
eiregobragh eiregobragh is offline
Registered User
 
Join Date: Jun 2010
Posts: 30
export list of hostnames and their IP address

Hi Guys,
I love secureCRT first off.

In my CRT setup I have a sessions folder where all my hostnames to my routeres and switches are stored.

Is there a way of extracting all these hostnames and their IP details into an excel sheet? I have to do an inventory of all our devices and it would save me lots of time if this could be done somehow.

Thanks,

Paul
Reply With Quote
  #2  
Old 07-19-2012, 12:31 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,316
Hi eiregobragh,

What version of SecureCRT are you using?

On what operating system?

What are the IP details you are referencing?

With SecureCRT v6.2 and later, you can pretty much get any of the values from a session's configuration using the SessionConfiguration Object and the
GetOption() method. That's the easy part.

SecureCRT's Help file topic Scripting / Script Objects Reference / SessionConfiguration Object includes additional information and examples.

We have limited example scripts that illustrate working with Excel, but the "ExcelSpreadsheets-ReadingAndWriting.vbs.txt" example in this other forum post might help you.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by jdev; 03-02-2018 at 06:00 PM.
Reply With Quote
  #3  
Old 08-14-2012, 05:08 AM
eiregobragh eiregobragh is offline
Registered User
 
Join Date: Jun 2010
Posts: 30
Hi Brenda,
thanks for your reply. My requirements have changed slightly. Now I would like to export from secureCRT 7.0.0 the following parameters from my list of sessions into an excel sheet:

Hostname

IP address

username

Do I have to use scripting or can it be done via the menu system or editing a file and saving it as an xml or csv for example? My scripting skills are not so good.

Thanks,

Paul
Reply With Quote
  #4  
Old 08-14-2012, 11:03 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,316
Hi Paul,

The example script in this thread will allow you to export SecureCRT session information to a comma-delimited file.

You should then be able to open that in Excel and it will recognize the data as delimited data and prompt you accordingly.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 08-14-2012, 11:07 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,316
Hi Paul,

Sorry, I pointed you to the wrong example script. That one is to import arbitrary data to SecureCRT.

The attached example script in this thread is the one I described.
Attached Files
File Type: txt IterateOverAllSessionsRecursively.vbs.txt (6.4 KB, 2647 views)
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #6  
Old 09-24-2012, 02:51 PM
Tekjunkie Tekjunkie is offline
Registered User
 
Join Date: Sep 2010
Posts: 20
Tried to run this and received and error on line 161 which i have highlighted in RED

Sub WriteToFile(strText, strFilePath)
Set objFile = g_fso.OpenTextFile(strFilePath, ForAppending, True)
objFile.WriteLine strText
objFile.Close
End Sub



I also had to add this to get it to run.


#$language = "VBScript"
#$interface = "1.0"
Reply With Quote
  #7  
Old 09-24-2012, 05:16 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 998
Quote:
Originally Posted by Tekjunkie View Post
Tried to run this and received and error on line 161
  1. What's the exact text of the error message you're getting?
  2. Have you verified with 100% certainty that the path contained in your strFilePath variable (traced up the stack to the g_strOutputFile variable) actually exists, including all path components + the actual file? If you're not entirely sure, add a "MsgBox strFilePath" statement right before the line of code that's erroring out on you and attempt running your script again. When the msg box appears, try accessing the displayed location using Windows Explorer.
  3. If the file indeed exists, does another application/editor currently have the file locked for editing?
  4. If the file exists, is it marked as read-only or otherwise have permissions disabled for your user to gain write/append access?


Quote:
Originally Posted by Tekjunkie View Post
I also had to add this to get it to run.
#$language = "VBScript"
#$interface = "1.0"
As explained in the scripting guide (section 1.1), you won't need these two header lines if you name your script with a .vbs extension (remove the .txt portion that was added in order to allow the attachment to be included in the forum post).

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #8  
Old 10-01-2012, 09:48 AM
Tekjunkie Tekjunkie is offline
Registered User
 
Join Date: Sep 2010
Posts: 20
Everything is working fine. Look like the issue was actually with were the files were. I keep them in a dropbox account I took a few different times to make it run but i never actually had to change anything.
Reply With Quote
  #9  
Old 02-28-2013, 08:55 AM
eiregobragh eiregobragh is offline
Registered User
 
Join Date: Jun 2010
Posts: 30
Hi CRT,
has there been any development on a step by step export of session files and their folders so I can share with my colleagues?

Or do we still have to do it the convoluted way via an export and import script?

Thanks,

Paul
Reply With Quote
  #10  
Old 02-28-2013, 10:36 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Paul,

SecureCRT does not yet have the ability to export sessions for sharing with a colleague. There are various methods for removing user specific information, and one of them would be a script.

We will post to this thread if we add the ability to export/import sessions (with the option to choose what is exported/imported) in the future.

If you would like to be notified directly, please complete and submit the form at the following location:
Submit Feature Request
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #11  
Old 03-01-2013, 08:25 AM
eiregobragh eiregobragh is offline
Registered User
 
Join Date: Jun 2010
Posts: 30
Hi again and thanks for the reply.

As I'm working for a large corporation and network team so without that feature it's hard to keep all our session lists synchronised amongst team members.

This feature would be VERY useful...!!!!!

When I use the export script it produces a csv. file with the following columns:

Session | Hostname | Protocol | Emulation | Description

However the Session column includes the folder names also, delimited by "/".

For the import script to run I need to change Session to session_name and delete the "/" symbols......but this just concatenates the folder name with the session name.


Is there a edited version of this import script which can maintain the folders and sessions when importing?

Many thanks again,

Paul
Reply With Quote
  #12  
Old 03-01-2013, 01:28 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Paul,

Thanks for the additional information. Have you considered using a configuration folder on a network share?

That would be an easy way to share a configuration folder among many users.

We don't have a modified version of the import script example. You can find the most current version of the example, which you are welcome to modify to meet your specific needs, at the following location:
http://forums.vandyke.com/showthread...7089#post37089
It might be easier to modify the script you are using to export the data and just parse the session name before writing out the session information and add a "folder" column.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #13  
Old 08-21-2014, 03:05 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi All,

The ability to export a SecureCRT configuration to and import it from an XML file has been added to SecureCRT 7.3. You can download the beta from the following location:
http://www.vandyke.com/download/securecrt/beta.html
The new options are located in the Tools menu.

We welcome any feedback about the new feature.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #14  
Old 08-22-2014, 01:59 AM
i9pk i9pk is offline
Registered User
 
Join Date: Jun 2014
Posts: 7
Quote:
Originally Posted by rtb View Post
Hi All,

The ability to export a SecureCRT configuration to and import it from an XML file has been added to SecureCRT 7.3. You can download the beta from the following location:
http://www.vandyke.com/download/securecrt/beta.html
The new options are located in the Tools menu.

We welcome any feedback about the new feature.
Hi, I've tried the beta version, i have about 2k sessions. when I exported about 50%, srt crashed, and even tried again.
Reply With Quote
  #15  
Old 08-22-2014, 07:35 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,316
Hello i9pk,

I am sorry to hear about SecureCRT crashing.

Did you receive the crash dump handler notification (indicating a crash dump file was created)?

We cannot really effectively troubleshoot this issue in the forums.

Please contact support@vandyke.com and reference "Forum Thread #10585".

If not writing from the same email address associated with your VanDyke Software download account, please include the email address you *did use* to register the account. We will likely have you upload the crash dump file.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


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

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 04:52 PM.