From: Tim Pease Date: 2006-09-07T23:25:38+09:00 Subject: Re: Telnet and 'waitfor' On 9/7/06, David Corticchiato wrote: > Hi, > > by reading the man i understood that 'waitfor' method could be used like > this : > > waitfor(String => 'Name', Timeout => 30) > > But, with that code... : > > > telnet_session = Net::Telnet.new('Host' => @apc_ip) > # @apc_ip is the ip of the host chosen > telnet_session.waitfor(String => 'User Name', Timeout => 30) > > > ...I have a timeout. Is this a syntax problem ? Just curious, but are you trying to connect to an APC Power Distribution Unit? Your choice of variable names -- @apc_ip -- just made me think of the APC PDUs we have here at work. Your telnet code looks correct except for the quoting, but I think you know that already. Try setting 'Output_log' to a filename when you create your telnet session. This will copy all telnet traffic to the given log file. It might be that what you are receiving is not what you are expecting telnet_session = Net::Telnet.new('Host' => @apc_ip, 'Output_log' => 'my_log.txt') Blessings, TwP