Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 08-30-2012, 04:05 PM
rtb rtb is offline
VanDyke Technical Support
Join Date: Aug 2008
Posts: 4,306
Post Example: Read Data From Separate Hosts/Commands File And Log To Individual Files

Demonstrates how to connect to hosts read in from a "hosts" file and for each host, send a list of commands read in from a "commands" file. Results of each command run are (by default) logged to separate, uniquely-named files based on the host address and the command that is run. However, the script code is architected to allow you to change this behavior so that it's all logged to one file per host, or even just to a single file.

Download the example scripts:
Python Version (for use on Mac/Linux/Windows versions of SecureCRT):
Last updated: 08 Jun, 2021

VBScript Version (for use on Windows versions of SecureCRT):
Last updated: 21 May, 2018

Example ##hosts.txt and ##commands.txt files:
The following show you the format of what the ##hosts.txt and ##commands.txt files would look like.The ##hosts.txt file can contain host-specific command file directives, which is what the ##DeviceType1Commands.txt and ##DeviceType2Commands.txt files exemplify.

Attached Files
File Type: txt ##hosts.txt (1.1 KB, 4123 views)
File Type: txt RunCommandsOnMultipleHostsAndLogResults.vbs.txt (44.4 KB, 8086 views)
File Type: txt ##commands.txt (575 Bytes, 4018 views)
File Type: txt ##DeviceType1Commands.txt (396 Bytes, 3439 views)
File Type: txt ##DeviceType2Commands.txt (399 Bytes, 2796 views)
File Type: txt RunCommandsOnMultipleHostsAndLogResults.py.txt (47.2 KB, 4554 views)

Last edited by jdev; 06-08-2021 at 09:46 AM. Reason: Update VBScript code and post newly-available Python version
Reply With Quote

example script

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