Can anybody point to a perl script that can issue IOS commands and
save to local files from a given IP list. I am currently using one of
the perl scripts and it doesn't have an error checking. So, whenever
the remote device from a given IP list is not respond, it stop. It
would be good to have a script that can skip the non-responding IP,
log the non-responding IPs, and continue with the rest of the IPs in
the given list.
Below is the script that I am currently using:
#!/usr/bin/perl -w
use Net::Telnet::Cisco;
@devices = `cat my_devices_ip_list.txt`;
foreach my $device (@devices) {
chomp($device);
my $session = Net::Telnet::Cisco->new(Host => $device);
$session->login('my_user_name','my_password');
$session->enable("my_enable_password");
@ver = $session->cmd("sh ver");
open LOG, "> $device.conf";
select LOG;
print @ver;
close LOG;
}
|