View Single Post
Old 08-22-2016, 09:59 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,093
Here are the steps I would suggest you take to create such a script:
  1. Handle secondary host logins correctly/reliably. Take a look at the example script "JumpHost-HandleSecondaryHostConnectionAttempt" found on the script examples "sticky". On line 32, you'll be editing that to perform a 'telnet' command instead of an 'ssh' command.
  2. Rename 'thing' to be more useful for you knowing exactly what it is (something like "strCurLine", for instance)
  3. Use another Split() call within your main 'For Each thing in MyVar' loop that separates out each component into tokens separated by comma characters. For example vTokens = Split(strCurLine, ",")
  4. Use appropriately-named variables to peel out the various tokens for use within your script. For example:
    strIP = vTokens[0]
    strWAN1 = vTokens[1]
    strWAN1IP = vTokens[2]
    '... etc.
    ...instead of thing1, and thing2 because this will help you to remember/know exactly what the variable means.

Also, take a look through the script examples available on the Script Examples "sticky". There are lots of examples that show techniques to perform tasks and there's code already there for the learning. For example, if you already have a spreadsheet with this information in it, there's an example of how to use the information directly from the spreadsheet to connect to a host (even from a gateway/jumphost scenario) and perform a series of commands -- see the "ExcelSpreadsheets-SearchingAndLookup-GatewayLogins" code in the Integrating with Microsoft Excel script example.

Jake Devenport
VanDyke Software
Technical Support
YouTube Channel:

Last edited by jdev; 11-09-2017 at 11:28 AM.
Reply With Quote