6 use Data::Dump qw(dump);
9 my ($self,$ip,$port) = @_;
11 warn "# hash $ip $port";
13 my $t = Net::Telnet->new( Timeout => 10, Prompt => '/#/' );
15 $t->dump_log('/tmp/log') if $ENV{DEBUG};
21 $t->waitfor('/Login:/');
23 $t->waitfor('/Password:/');
27 $t->waitfor('/Please input password:/');
36 $command .= ' ' . $port;
43 my($prematch, $match) = $t->waitfor('/(Press any key to continue \(Q to quit\)|#)/');
45 last if $match eq '#';
49 warn "## out = [$out]";
52 foreach my $line ( split(/[\n\r]+/, $out) ) {
54 if ( $line =~ m/^(\S+.*?)\s+:\s+(\S+.*)$/ ) {
71 foreach my $name (@_) {
72 warn "# copy $name ", dump( $row ),$/;
73 $row->{$name} = $hash->{$name};
77 $hash = command 'show interface';
84 $hash = command 'show adsl status';
89 $hash = command 'show adsl physical';
105 warn "# row = ",dump $row;