Michael Butler/CanEast/IBM wrote:

> Sorry for the off topic question but I'm scratching my head here. I've
> written a perl script to do a telnet to a server and run an arbitrary
> command. Doing a "who" on the server indicates that I do indeed get
> connected. However, after the specified timeout I get "connection timed out
> waiting for a command prompt". Here's my code:
>
> #!/usr/bin/perl
> use Net::Telnet;
> $telnet = Net::Telnet->new
> (
>  Timeout=>10, Prompt=>'/[\$%#>] $/', Host=>'berkeley'
>  );
> $telnet->login('mbutler', 'xxxxx');
> @listing = $telnet->cmd("ls");
> print @listing;
> $telnet->close;
>
> Anyone got any ideas?

Not really but I assume the time out is coming from the login?  Does the prompt
attribute match what the server gives?  I have never used the Telnet class but
am guessing the the promt attribute is how the module knows that te login was
sucessful.

I would use ethereal to sniff the network and see the traffic and see what is
coming back from the server.

Bret





_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to