cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
340
Views
0
Helpful
1
Replies

How to add enable password to ShowCollector Python script

dleboeuf
Level 1
Level 1

Hello all,

I recently found the ShowCollector Python script in the Cisco Code Exchange and am running in to some slight issues with it. I am able to run the script against my list.txt file which has all of the IP addresses with out any issues, but the issue I am running into is that the credentials I have for these devices require me to enter in the enable password, so whenever I run the script, it's not able to run the 'show running-configuration | include hostname' command, so it isn't creating a new file for each switch, it just keeps overwriting the one file because it can't locate the hostname. I don't really know much about Python so am looking for some assistance on adding the enable password to the script. I tried a few different things out but nothing seemed to work because I don't really know what I am doing. Here is a link to the GitHub page that has the script:

https://github.com/dgancedo/ShowCollector

 

Thanks!

1 Reply 1

balaji.bandi
Hall of Fame
Hall of Fame

that works if the user is already in priv 15 - if not you need to parse the secret to entering enable mode.

that required tweak in the code with expect.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: