Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: ciscodump - dump config info from routers into files

by stevieb (Canon)
on Nov 06, 2015 at 15:30 UTC ( #1147105=note: print w/replies, xml ) Need Help??


in reply to ciscodump - dump config info from routers into files

One way to avoid having the password documented in the config file, is to provide the user of the script the option of setting it in their shell's ENV instead. This would be temporary and only visible within the current shell running the script. If they have different passwords for each device, it would be cumbersome (it could be done though). Here's an (untested) example:

my $pass; if (defined $ENV{PASS}){ $pass = $ENV{PASS}; } elsif (defined $ini->{$host}{pass}){ $pass = $ini->{$host}{pass}; } elsif (defined $ini->{_}{pass}) { $pass = $ini->{_}{pass} } else { die "no password could be found"; }

Replies are listed 'Best First'.
Re^2: ciscodump - dump config info from routers into files
by soonix (Canon) on Nov 06, 2015 at 20:44 UTC

    Yes, that would have been an option, as in my case, there was only 1 system with a different password.

    But as we are using KeePass already, the next step may probably incorporating File::KeePass. Now, the password for the KeePass database… ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1147105]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2021-01-25 15:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?