How to add enable password to ShowCollector Python script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 01:55 PM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 12:10 AM
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.
