[ale] expect scripting question

Danny Cox danscox at mindspring.com
Fri Apr 12 07:06:47 EDT 2002


Gene,

On Thu, 2002-04-11 at 16:46, Gene Matthews wrote:
> I'm trying to write an expect script to test a remote console server.
> 
> I have the following script:
> 
> My perl script first tries to ping the box, and if the box is reachable
> I want to call this expect script and be able to determine if the telnet
> was successful.  I want to be able to determine if the telnet connection
> is 1) refused, 2) times out, or 3) successful.

	Since you're already using Perl, you could use it directly to connect
to port 23 of the box.  The return from that connect will tell you 1, 2,
or 3 when it returns.  At that point, if successful, you can just close
the socket.  You should even be able to play with the timeout value, if
you "know" your box respnds quickly.

-- 
kernel, n.: A part of an operating system that preserves the
medieval traditions of sorcery and black art.

Danny


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list