Dear Monks
I am not able to login onto DSL Switch using perl code, Same script on other switch from other vendors is successful without any issues. From past 2 weeks I am re-writing the code in different ways but no success. Seems like the Telnet server based on the VxWorks Target is having minute details that I am not able to understand. Please help me to solve this puzzle.
use IO::Socket; #============Main=============== my $sock; $sock=login_router(); print $sock; exit; #============End=============== sub login_router { my $socket; $socket = new IO::Socket::INET (PeerAddr => "192.168.1.240", + PeerPort => "23" , Proto => 'tcp') ; if ($socket) { print "Connection is established\n"; } else { die "Error: $!"; } sleep(4); $socket->autoflush(); my $input = ""; my $char = ""; until ($input =~ /Login :/){ $socket->sysread($char, 1); $input .= $char; } print $input; # Write the login name syswrite $socket, "ecidslam\r\n"; sleep(2); # Wait for the Password prompt my $input = ""; my $char = ""; until ($input =~ /Password :/){ $socket->sysread($char, 1); $input .= $char; } print $input; syswrite $socket, "Hi-FOCuS\r\n"; # To read the output from the socket while(<$socket>) { last if (/welcome/); die "Exit... Login error\n" if (/Permission Denied/); # Print each line read from socket print $_; } return $socket; }
On Executing Perl code following is the trace
C:\Perl>perl login.pl Connection is established VxWorks vxTarget Login : v? ²? ¦?am Password :******** Exit... Login error
Login using hyperterminal
Manual login onto the DSL Swith will have following trace VxWorks vxTarget Login :ecidslam Password :******** Welcome IPNI >
In reply to Login to ECI DSL switch fails always by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |