Mailing List Archive

Controlling a client session with Perl/Expect
I'm trying to get a Perl script (with the Expect module installed) to
control a session with the client. The username/password interaction
works but everything after that (the escaped control key sequences) seem
to disappear into the bit bucket. I've looked at the users Archive back
to July 2002 but didn't see anything that would help. What am I doing
wrong? Is there some config parameter that I've missed?
Conserver is running on Solaris 8. Conserver version 7.2.2; I know, it's
old, really old, and I've requested that it be upgraded to the latest
version. Will that fix my problem?

Perl version 5.6.1, Expect version 1.15
The Perl/Expect environment appears to work. I've been able to control
FTP sessions with it. In trying to control a console session, the
Perl/Expect script times out waiting for the "[ Enter '^EC?' for help ]"
string after the username/password has been exchanged. I also tried
using Perl/Telnet to do the same thing from a remote system and had a
similar problem, the username/password part works but Telnet times out
waiting for the "[ Enter '^EC?' for help ]" string. I turned on the
Telnet logging to see what was going and the string shows up in the log
but Telnet never responds to it.

Or maybe there is a better way to programmatically control a client
session without using Perl? Any suggestions, ideas, help is greatly
appreciated.

--
Paul.Waleski@Oracle.com Office:(650)506-2376 Fax:(650)506-7406
Programmer Analyst - Server Technologies IT
Oracle Corporation 500 Oracle Parkway M/S 2op3
Redwood Shores, California 94065

_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: Controlling a client session with Perl/Expect [ In reply to ]
You need to use Expect with my Console.pm

On Mon, 2005-11-28 at 16:11 -0800, Paul Waleski wrote:
>
>

_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
RE: Controlling a client session with Perl/Expect [ In reply to ]
Do tell...more info, please. (URL, man page? :-)

-Z-

-----Original Message-----
From: users-bounces@conserver.com [mailto:users-bounces@conserver.com]On
Behalf Of Christopher Fowler
Sent: Monday, November 28, 2005 4:20 PM
To: Paul Waleski
Cc: users@conserver.com
Subject: Re: Controlling a client session with Perl/Expect

You need to use Expect with my Console.pm

_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: Controlling a client session with Perl/Expect [ In reply to ]
In a flurry of recycled electrons, Zonker Harris wrote:
> Do tell...more info, please. (URL, man page? :-)

Or you could forget about perl and just use expect with tcl :-). That
works quite well.

(I've never heard of anyone actually using expect/perl. Pretty much
everyone I've met uses tcl. OTOH, if it works for you, go for it.)

z!
_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: Controlling a client session with Perl/Expect [ In reply to ]
On Mon, 2005-11-28 at 16:40 -0800, Carl Zwanzig wrote:
> (I've never heard of anyone actually using expect/perl. Pretty much
> everyone I've met uses tcl. OTOH, if it works for you, go for it.)

I use Expect/Perl every week. I have agents that interact with modems
and remote devices over modems using Expect/Perl. It works great!


_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: Controlling a client session with Perl/Expect [ In reply to ]
On Mon, 2005-11-28 at 17:22 -0800, Paul Waleski wrote:
> I'll need to know where to get this module and any documemtation.

You'll have to write your own.

This is a module we hacked out for internal use. I've attached it and
if you want to make enhancements please do so and return. It works
great.

my $con = Console->new('192.168.1.120', 'console', 'root', 'password');
$con->connect();
my $socket = $con->getConnection();

Give expect the file handle and you're done!

I've sent this to the list because all can benefit and it is "free"
code. Just share all you do so all can enjoy the better code.
I've not had time to include more OOP type error handling. This was a
quick hack that we use to connect and do testing for our devices
attached to our console servers.



>
> Christopher Fowler wrote:
>
> >You need to use Expect with my Console.pm
> >
> >On Mon, 2005-11-28 at 16:11 -0800, Paul Waleski wrote:
> >
> >
> >>
> >>
> >
> >
> >
>
Re: Controlling a client session with Perl/Expect [ In reply to ]
On Mon, 2005-11-28 at 20:31 -0500, Christopher Fowler wrote:
> You'll have to write your own.

I meant documentation.. Not code. The code is free :) Who has time to
write documentation.

_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users
Re: Controlling a client session with Perl/Expect [ In reply to ]
On 11/28/05 4:40 PM, "Carl Zwanzig" <cpz@tuunq.com> wrote:

> (I've never heard of anyone actually using expect/perl. Pretty much
> everyone I've met uses tcl. OTOH, if it works for you, go for it.)

I run several high volume manufacturing lines with conserver and expect.
Works great.

Scott(A)


_______________________________________________
users mailing list
users@conserver.com
https://www.conserver.com/mailman/listinfo/users