Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: conserver: users

Controlling a client session with Perl/Expect

 

 

conserver users RSS feed   Index | Next | Previous | View Threaded


paul.waleski at oracle

Nov 28, 2005, 4:11 PM

Post #1 of 8 (2624 views)
Permalink
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 [at] Oracle 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 [at] conserver
https://www.conserver.com/mailman/listinfo/users


cfowler at outpostsentinel

Nov 28, 2005, 4:20 PM

Post #2 of 8 (2526 views)
Permalink
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 [at] conserver
https://www.conserver.com/mailman/listinfo/users


Zonker.Harris at bigbandnet

Nov 28, 2005, 4:33 PM

Post #3 of 8 (2522 views)
Permalink
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 [at] conserver [mailto:users-bounces [at] conserver]On
Behalf Of Christopher Fowler
Sent: Monday, November 28, 2005 4:20 PM
To: Paul Waleski
Cc: users [at] conserver
Subject: Re: Controlling a client session with Perl/Expect

You need to use Expect with my Console.pm

_______________________________________________
users mailing list
users [at] conserver
https://www.conserver.com/mailman/listinfo/users


cpz at tuunq

Nov 28, 2005, 4:40 PM

Post #4 of 8 (2528 views)
Permalink
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 [at] conserver
https://www.conserver.com/mailman/listinfo/users


cfowler at outpostsentinel

Nov 28, 2005, 5:20 PM

Post #5 of 8 (2520 views)
Permalink
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 [at] conserver
https://www.conserver.com/mailman/listinfo/users


cfowler at outpostsentinel

Nov 28, 2005, 5:31 PM

Post #6 of 8 (2529 views)
Permalink
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:
> >
> >
> >>
> >>
> >
> >
> >
>
Attachments: Console.pm (3.42 KB)


cfowler at outpostsentinel

Nov 28, 2005, 5:46 PM

Post #7 of 8 (2519 views)
Permalink
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 [at] conserver
https://www.conserver.com/mailman/listinfo/users


sailnit at speakeasy

Nov 29, 2005, 8:48 AM

Post #8 of 8 (2526 views)
Permalink
Re: Controlling a client session with Perl/Expect [In reply to]

On 11/28/05 4:40 PM, "Carl Zwanzig" <cpz [at] tuunq> 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 [at] conserver
https://www.conserver.com/mailman/listinfo/users

conserver users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.