|
![]() |
|
Thread Tools | Rate Thread | Display Modes |
#46
|
|||
|
|||
Hello iabudi,
Todd is not available. What type of device are you connected to at the time the issue occurs? What was the command that was sent?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#47
|
|||
|
|||
cisco Script
Quote:
I sent show ip route and the second command is show log the script created the file then sent the show ip route (from the command file) I get back the ip route table and at the end I get the router prompt. Router# then it just sits there. until I stop script. and I get the line 399 message. How can I send you the script? |
#48
|
|||
|
|||
Hi iabudi,
I am back. Please send the script to support@vandyke.com with a subject of Attn: Todd - Script Problem. Please include the version of SecureCRT that you are using and ensure that there are no saved passwords in the script. |
#49
|
|||
|
|||
![]()
I got the version working fine with just doing the 'host' / filename combo, but would like it to just do filename like
hostname.txt Which contains the complete results of each command in one file as opposed to tons of little files. I did try modifying the filename output function but just foobard it and couldn't get it to work. Any ideas? Thomas |
#50
|
|||
|
|||
Hi Thomas,
Thanks for the post. If you want to have a single host results file rather than files for each command, you would change the line that writes data in the for strCommand in vCommandsList loop to a line that aggregates the results. You would then write out the data after the loop is complete. In the original Python example, it would be lines 405 to 416 that would aggregate the output. Lines 417 and 418 would need to be unindented one level, and prior to line 417, you would write out the variable that you used to aggregate the output for all commands run on the host. You may also want to add some error handling to capture instances where the connection hangs when aggregating the output so you can get out of the loop. Finally, and maybe firstly, lines 380 to 393 would probably need to be moved out of the loop and just prior to writing out the aggregated log. You may also want to change the file name in the GetSafeFilename() function. Does this help? If you need more help, post your script along with what behavior you are seeing, and I can see what might be going wrong. NOTICE: The requested troubleshooting data may include sensitive information (usernames, passwords, publicly-accessible host names or IP addresses, etc.). |
#51
|
|||
|
|||
Modified script never executes commands
I am using the 'original' script, but it never runs any commands, it just waits there forever.
I am using it on a UNIX system, and have no idea why it doesn't process commands. |
#52
|
|||
|
|||
Thanks for the update Thomas.
To see what might be happening, I would need to see the script. You are welcome to post it or send it to support@vandyke.com with a subject of Attn: Todd - Forum thread #10651. |
#53
|
|||
|
|||
Hello,
First of all I want to say thank you for writing this most excellent script. ![]() I am using the python script and my version of SecureCRT is Version 7.3.1 (build 685) on my Mac OS X Yosemite. I am only running one command "show running-config" and it works, but the script does not know what to do when it sees " --More--", it is disconnecting from host and going to next host. I would like for it to send the spacebar everytime " --More--" appears until it reaches the "#", then it can disconnect and continue to next host. How can I manipulate the script to make this work? Thanks in advance! |
#54
|
|||
|
|||
Hi vladiny,
Thanks for the post. I am glad to hear that you find the script example useful. My suggestion would be to add a command to temporarily disable paging prior to running the show command. Would this work for you? If not, you would have to modify line 404 to wait for multiple strings and take action based on the different strings that could be found. This would have to be added to a loop and you would have to aggregate the results in a variable. A VBScript example of how this would be done is found on pages 50 and 51 of the scripting manual. A URL to the manual is at the following location: https://forums.vandyke.com/showthread.php?t=3634 |
#55
|
|||
|
|||
![]() Quote:
![]() I really don't know anything about writing scripts, so modifying that script would have turned out a disaster. Any videos out there that teach you how to write scripts? That would be nice as I am more of a visual person ![]() |
#56
|
|||
|
|||
Hi vladiny,
Thanks for the update and information. I am glad to hear that you found the command you needed for your devices. I don't know anything about Cisco devices, so this may be of no value, but if that command is not temporary, you may want to add a third command to set paging back to what you expect it to be when manually interacting with a device. |
#57
|
|||
|
|||
Quote:
Todd, I am running the script and noticing that it is logging each command per host. I only want the script to output all commands per host. Can you show me how to accomplish this? Thanks in advance! |
#58
|
|||
|
|||
Hi vladiny,
There isn't an easy, error proof way to modify the Python version of this example to accomplish your goal. We are considering re-writing the Python version to be more similar to the VBScript version, but have no ETA on that. |
#59
|
|||
|
|||
For some reason the python version is not working for me but vbscript version does. Also, it it easy to also add to the script so it handles Tacacs. So, after logging in, it issues "enable" and enters the enable password.
I tired adding lines after it send login pawword but it didn't work. I also added "en" and my enable password in "commads.txt" but it wouldn't enter the enable password. |
#60
|
|||
|
|||
Hi All,
We are working on this issue via email. If we can find out what is wrong in this specific case and environment, I will post here. |
![]() |
Tags |
example script |
Thread Tools | |
Display Modes | Rate This Thread |
|
|