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?

Another data point:

Worked for me connecting to a pinstripe box.  The only one I have running
telnet.  I just changed the host, username and password in your script and...
bingo a listing of the home dir.

BTW I used the ipaddress since the test box IP is not resolved via my internal
DNS.  I don't know what your setup is but that might be worth a try.  Have you
tried increasing the timeout?

Hope this helps,

Bret



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

Reply via email to