6 use Data::Dump qw(dump);
12 warn "# info ", dump($args);
14 my $t = Net::Telnet->new( Timeout => 10, Prompt => '/#/' );
16 $t->dump_log('/tmp/log') if $ENV{DEBUG};
19 $t->open( $args->{ip} );
22 $t->waitfor('/Login:/');
24 $t->waitfor('/Password:/');
28 $t->waitfor('/Please input password:/');
38 $command .= " $args->{slot}/$args->{port}";
45 my($prematch, $match) = $t->waitfor('/(Press any key to continue \(Q to quit\)|#)/');
47 last if $match eq '#';
51 warn "## out = [$out]";
54 foreach my $line ( split(/[\n\r]+/, $out) ) {
56 if ( $line =~ m/^(\S+.*?)\s+:\s+(\S+.*)$/ ) {
73 foreach my $name (@_) {
74 warn "# copy $name ", dump( $row ),$/;
75 $row->{$name} = $hash->{$name};
79 $hash = command 'show interface';
86 $hash = command 'show adsl status';
91 $hash = command 'show adsl physical';
107 warn "# row = ",dump $row;