Hi Brett,
Thanks for the help. At least I know the code works. I can't connect to a
RedHat 6.2 box or any one of 10 AIX boxes. Interesting that it would work
for you. I'll try by ip address although I know that I can connect by name
its just that I get the response that it is waiting for a command prompt.
Thanks again
Mike
Bret Hughes <[EMAIL PROTECTED]> on 09/12/2000 08:18:02 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: Re: [OT] Perl Telnet script
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
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list