Hi all
I have started toying with net::telnet, this is my butchered script for ISO upgrades, but it times out leave me with partial images.
can anyone advise wjhat I am missing ?
TIA Sam
use Net::Telnet::Cisco;
$username = "sam";
$password = "cisco";
$enable = "cisco";
my $IP = '10.1.1.1';
my $TFTP = 'cisco/ios/4510/cat4000-i9s-mz.122-25.EWA12.bin';
my $IMAGE = 'cat4000-i9s-mz.122-25.EWA12.bin';
@hosts = qw (
RTR1
);
foreach $host ( @hosts ) {
my $conn = Net::Telnet::Cisco ->new (HOST => $host);
$conn-> login( name => $username,
Password => $password);
if ($conn->enable($enable) ) {
} else {
warn "Can't enable: " . $conn->errmsg;
}
@output=$conn->cmd(
"copy tftp bootflash:
$IP
$TFTP
$IMAGE
");
print @output;
}
I have started toying with net::telnet, this is my butchered script for ISO upgrades, but it times out leave me with partial images.
can anyone advise wjhat I am missing ?
TIA Sam
use Net::Telnet::Cisco;
$username = "sam";
$password = "cisco";
$enable = "cisco";
my $IP = '10.1.1.1';
my $TFTP = 'cisco/ios/4510/cat4000-i9s-mz.122-25.EWA12.bin';
my $IMAGE = 'cat4000-i9s-mz.122-25.EWA12.bin';
@hosts = qw (
RTR1
);
foreach $host ( @hosts ) {
my $conn = Net::Telnet::Cisco ->new (HOST => $host);
$conn-> login( name => $username,
Password => $password);
if ($conn->enable($enable) ) {
} else {
warn "Can't enable: " . $conn->errmsg;
}
@output=$conn->cmd(
"copy tftp bootflash:
$IP
$TFTP
$IMAGE
");
print @output;
}