#1
|
|||
|
|||
Modify the Cisco-SaveDeviceConfigToFile.py
Hi!
How could I modify the Cisco-SaveDeviceConfigToFile.py script to use "show running-config all", because it would be more suitable for me? Consider I don't have any clue about Python... ![]() Thanks in advance! |
#2
|
|||
|
|||
Hi SchwabenGeiz,
I think you will need to alter line 266: Code:
strCmd = "show " + g_strConfigToSave + "-config\r" Code:
strCmd = "show " + g_strConfigToSave + "-config all\r"
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Quote:
thanks for your reply! I have tried it out, but I can not save the config as file, because the dialogue isn't showing and I need to cancel the script manually. Do you have an idea why? Jake, could you please help? Thank you in advance! |
#4
|
|||
|
|||
Hi SchwabenGeiz,
What dialog is not showing? Quote:
What error do you get when you choose Cancel from the Script menu?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#5
|
|||
|
|||
![]()
The Choose where to save your running-config dialog is not popping up.
I'm not reffering to anything within the Python code, because I do not have a clue about it ![]() ![]() Quote:
After cancelling the script manually, there is error message: Script Cancelled File: C:\Users... Line: 270 Thank you in advance! Last edited by SchwabenGeiz; 04-06-2018 at 01:19 AM. Reason: Image not showing |
#6
|
|||
|
|||
Hi SchwabenGeiz,
So that is this line: Code:
objTab.Screen.WaitForString("Current configuration : ") That's what you will want to change the WaitForString() to. The line following is used to mark the end of info that is not written to the file: Code:
nBytes = objTab.Screen.ReadString(" bytes\r\n")
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#7
|
|||
|
|||
Hi SchwabenGeiz,
There have been some updates made to the original script here that should help you accomplish your objective. ![]()
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#8
|
|||
|
|||
Hi bgagnon,
it's working as a charm right now! The script looks like this right now (line 269+270): Code:
if g_strConfigToSave == "running": objTab.Screen.WaitForString("Current configuration with default configurations exposed : ") Of course I will try the new version with additional arguments. Thanks for your help! |
![]() |
Tags |
python , script |
Thread Tools | |
Display Modes | Rate This Thread |
|
|