|
#1
|
|||
|
|||
For Loop not running all commands
Hi,
This is my first post. I am evaluating the software to see if it will be useful for us. I have written a script that gathers the output from show commands. The script uses a for loop to run these commands against an array of IP addresses. For testing, I am running the script against 3 IP addresses. The issue I am having is that the script only runs the first few show commands against the first two IP addresses in the array. But It always runs all the commands against the last IP. I originally used crt.Screen.WaitForString "#" to detect when a command had finished. I had issues with this because our run file contains # in it. This leads the script to think that the output what finished prematurely. I created a system to capture the exact hostname of the device and use that to detect when a command finishes. I have tried changing the order of the IP addresses. But the script always does the same thing. Only the last IP address in the array works as intended. It is like the script is in a hurry and just skips the last few show commands. Then when it gets to the last IP it has plenty of time and runs all the commands. Here is my script. Any insite would be greatly appreciated! Quote:
|
#2
|
|||
|
|||
Hi joshua.peterson,
Welcome! Your objective sounds much like what is accomplished with this example script. It reads the hosts from a hosts file and the commands from a commands file. Do you think that might work for you? (This way we don't have to "reinvent the wheel".)
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Thanks!
We switched to using the python version and it works great! |
#4
|
|||
|
|||
Thanks We used the python script from your link and it worked great!
|
#5
|
|||
|
|||
Hi Joshua.peterson,
Great! Thanks for posting the update. ![]()
__________________
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 |
|
|