# #Use the Net Telnet Cisco module to getting into routers #Richmon Schumann 2-15-03 ###################################################################### use Net::Telnet::Cisco; ###################################################################### #This opens my log file for output open (LOGFILE, '>mylogfilepath') or die "Cannnot open log file : $!\n" +; # #This opens my seed file and stores it into an array # open (FILE, 'myseedfilepath') or die "Cannot open file : $!\n"; my @array = <FILE>; chomp @array; # #This does the telnet into the routers and logs the output to the logf +ile foreach my $ip (@array) { print { 'LOGFILE' } "$ip\n"; my $Telnet = Net::Telnet::Cisco->new(Host => $ip); $Telnet->login(Name => 'user', Password => 'pass'); print { 'LOGFILE' } $Telnet->cmd('show line 1'); print { 'LOGFILE' } $Telnet->cmd('show line 5'); } # close LOGFILE; close FILE;
In reply to Cisco Telnet by CongoGrey
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |