Hi everyone,
I am currently trying to pull the running config from various Cisco devices. I decided I would start with the basics and pull from one device to start with and then alter the script. My issue is that I can't even get that right!
When running the below script it is constantly asking for the password. If I manually provide the same password (when prompted) that is referenced in the script I can see on the switch that it logs in successfully, however the script keeps on prompting for it.
use strict; use warnings; use Net::Appliance::Session; my $ios_device_ip = '10.10.1.1'; my $ios_username = 'redacted'; my $ios_password = 'redacted'; my $running_config_file = "$ENV{HOME}/running_config.txt"; my $session_obj = Net::Appliance::Session->new( host => $ios_device_ip, personality => 'ios', transport => 'SSH', ); # try to login to the ios device, ignoring host check $session_obj->connect( Name => $ios_username, Password => $ios_password, SHKC => 0 ); # get our running config my @running_config = $session_obj->cmd('show running'); # chop out the extra info top and bottom of the config @running_config = @running_config[ 2 .. (@running_config -1)]; open(FH, "> $running_config_file") or die("Cannot open config file : $!"); print FH @running_config; close FH; # close down our session $session_obj->close;
The password does have special characters in it. I have tried using the " quotes round the password but hasn't made any difference.
Could anyone advise on what I should be looking at?In reply to Issue with Net::Appliance::Session by ThePerlNoob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |