#1
|
|||
|
|||
Loop on While Not {name}.atEndOfStream connection list.
I would like to create a VBS script what would connect to multiple hosts and collect data. Pause a specified amount of time and then reconnect to each device and collect the data again.
1. do while x 2. Connect to each device 3. Collect output from show commands 4. End 5. Pause a prefined time 6. loop x Please see the attached script for more details. Currently I have two duplicate sections with a different "While Not {}.atEndOfStream". Instead I would like to loop back to the top. |
#2
|
|||
|
|||
Hi dsautter,
There was nothing attached. What version of SecureCRT are you using? On what platform? If Windows and if you are making your connections within the script, this would seem like the sort of task where you might use a SecureCRT command-line: SecureCRT /Script "Path_to_my_script"And maybe run it as a scheduled task at the desired interval. If you do post the script, please elaborate on what undesired behavior you are seeing.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Script attached
Hello Brenda,
The version is 8.7.1 on Windows 2008 R2 server. Currently the only way to accomplish what I'm trying is to have multiple sections where it would be great to have the one section and just loop through it. Thanks, Don |
#4
|
|||
|
|||
Hi Don,
I'm trying to understand the relevance of the source files. What is the reason for separate files? Why wouldn't you just have one file for reading in all the devices?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
Response
Hello Brenda,
Let me see if I can explain what I'm trying to accomplish. We want to run a test over a 48 period. Within the 48 hours, we want to connect to all the devices in the list, grab outputs from show commands, and then pause for 4 hours. After the 4 hours, connect to all the devices again, run the same commands, and repeat 11 more times. Time 0 top While Not DeviceIP2.atEndOfStream "Connect to each device" collect outputs end if wend sleep for 4 hours loop to top I'm struggling with the outer loop, pause four hours, then go back to the "While Not DeviceIP2.atEndOfStream" to start the process of connecting to all devices and running the show commands. |
#6
|
|||
|
|||
Hi Don,
I still don't understand the need for multiple DeviceIP# files. ![]() Since the time iterator is known and VBScript functions can determine exact number of hosts in the file, I would just do this with two For/Next loops: Code:
read source file split ip's into array for x = 0 to 11 for y = 0 to ubound(hosts) connect run cmds log output next sleep 4 hrs next
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#7
|
|||
|
|||
Reply
Hello Brenda,
I removed the second section and uploaded the script with comments to try and simplify the ask. Hope this helps. Thanks, Don |
#8
|
|||
|
|||
Hi Don,
I posted what I felt was a reasonable alternative. I don't know how to accomplish it in the way you apparently want to accomplish it. ![]() So we will just have to leave this open for community input.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|