Perl telnet

Hi all,

Im trying to make telnet session to one of my 700 switches and im using the Net::Telnet module and have this error ... "timed-out waiting for login prompt at telnet.pl line 13". that is this line "$t->login($username, $passwd);" but the username and password iv used are not wrong. What i have missing. The code iv used is like the module example..

use Net::Telnet ();
    $t = new Net::Telnet (Timeout => 10,
                          Prompt => '/bash\$ $/');
    $t->open($host);
    $t->login($username, $passwd);
    @lines = $t->cmd("who");
    print @lines;

And i have error time out and it is because of wrong prompt. So i need a solution about this prompt. Im using perl on my windows machine and the switches that im trying to connect is Dell. Any suggestions ?

The code is correct it's a perldoc example. Make sure the $host variable is assigned correctly.

In windows, try this :Get into cmd

try using the default port

telnet  hostname 23

See if you can connect. And then login. If you fail, find out what port you should use. Some flavors of telnet require ports like 992 for example, not the default 23.

After it works manually, transfer that information into your code. The perldoc article shows how to set port and other options.

I have clear connection from cmd ... i can get to in any switch ... the port is default 23, i have no problems connecting from cmd or any other host like linux or from another switch or router to the switch