Net::Telnet prompt problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I get this error when running my small test program...

timed-out waiting for login prompt

$host = '';
$port = '24';
$username = 'admin';
$password = '';
$prompt = '/User:/';
$session = new Net::Telnet
        Timeout => 5,
        Prompt  => $prompt

$session -> open(Host => $host,Port => $port);
$session -> login($username, $password);

Here is the ouput from inputlog.txt:


I am guessing there is a problem with prompt, but I have tried a few
different matches without success...

Any help?


Re: Net::Telnet prompt problem wrote:
Quoted text here. Click to load it

Prompt has no effect on login function. Well, it does, but not on
username/password command-line patterns.
login function waits for patterns like this:

/login[: ]*$/i
/username[: ]*$/i
/password[: ]*$/i

You have the prompt "User:", that is why login times out; Try using
print/waitfor instead. It  can be something like this:

and so on.

Hope this Helps a little.

Maxim Sloyko

Re: Net::Telnet prompt problem

Helps a lot!

Thanks this works.

Site Timeline