RE: Net::Telnet

2005-06-02 Thread Thomas, Mark - BLS CTR
John wrote:
 its does not work on these servers:
 Windows 2000 Pro,
 Windows XP pro,
 Windows 2000 server pro,
 Windows server 2003.
 
 Reason is, the new windows server uses ANSI codes and you CAN'T turn
 them off like on a UNIX box. These ANSI codes garble up the 
 responses to Net::Telnet.

I'd put it this way: The telnet server in these versions of Windows is
broken. It doesn't follow the RFCs. To make telnet work, use an alternate
telnet server, e.g. http://kpym.sourceforge.net/

-- 
Mark

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Net::Telnet

2005-06-02 Thread Aaron.Tesch
I have had no issues using Net::Telnet on XP Pro that are using the MS
Windows telnet server.

Stating that it does not work on Windows server/workstations is not
entirely true.  

Try starting the MS Windows telnet server, and using it.  



- Aaron

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Thomas, Mark - BLS CTR
Sent: Thursday, June 02, 2005 7:35 AM
To: 'John Serink'; Rajesh Vattem;
perl-win32-users@listserv.ActiveState.com
Subject: RE: Net::Telnet

John wrote:
 its does not work on these servers:
 Windows 2000 Pro,
 Windows XP pro,
 Windows 2000 server pro,
 Windows server 2003.
 
 Reason is, the new windows server uses ANSI codes and you CAN'T turn
 them off like on a UNIX box. These ANSI codes garble up the 
 responses to Net::Telnet.

I'd put it this way: The telnet server in these versions of Windows is
broken. It doesn't follow the RFCs. To make telnet work, use an
alternate
telnet server, e.g. http://kpym.sourceforge.net/

-- 
Mark

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Net::Telnet

2005-06-02 Thread John Serink
Correct.

 -Original Message-
 From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, June 02, 2005 8:35 PM
 To: John Serink; Rajesh Vattem; 
 perl-win32-users@listserv.ActiveState.com
 Subject: RE: Net::Telnet
 
 
 John wrote:
  its does not work on these servers:
  Windows 2000 Pro,
  Windows XP pro,
  Windows 2000 server pro,
  Windows server 2003.
  
  Reason is, the new windows server uses ANSI codes and you 
 CAN'T turn 
  them off like on a UNIX box. These ANSI codes garble up the 
 responses 
  to Net::Telnet.
 
 I'd put it this way: The telnet server in these versions of 
 Windows is broken. It doesn't follow the RFCs. To make telnet 
 work, use an alternate telnet server, e.g. 
 http://kpym.sourceforge.net/
 
 -- 
 Mark
 
 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Net::Telnet

2005-06-02 Thread John Serink
I have heard the MS Telnet server was fixed on XP (and that would seem
then on 2003) but have not tested it. I know Net::Telnet did NOT work on
Win2K pro, I wasted about a week trying to get it to. Worked fine on NT
4.0 though.

Cheers,
John

 -Original Message-
 From: Aaron.Tesch [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, June 02, 2005 9:22 PM
 To: Thomas, Mark - BLS CTR; John Serink; Rajesh Vattem; 
 perl-win32-users@listserv.ActiveState.com
 Subject: RE: Net::Telnet
 
 
 I have had no issues using Net::Telnet on XP Pro that are 
 using the MS Windows telnet server.
 
 Stating that it does not work on Windows 
 server/workstations is not entirely true.  
 
 Try starting the MS Windows telnet server, and using it.  
 
 
 
 - Aaron
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Thomas, Mark - BLS CTR
 Sent: Thursday, June 02, 2005 7:35 AM
 To: 'John Serink'; Rajesh Vattem; 
 perl-win32-users@listserv.ActiveState.com
 Subject: RE: Net::Telnet
 
 John wrote:
  its does not work on these servers:
  Windows 2000 Pro,
  Windows XP pro,
  Windows 2000 server pro,
  Windows server 2003.
  
  Reason is, the new windows server uses ANSI codes and you 
 CAN'T turn 
  them off like on a UNIX box. These ANSI codes garble up the 
 responses 
  to Net::Telnet.
 
 I'd put it this way: The telnet server in these versions of 
 Windows is broken. It doesn't follow the RFCs. To make telnet 
 work, use an alternate telnet server, e.g. 
 http://kpym.sourceforge.net/
 
 -- 
 Mark
 
 ___
 Perl-Win32-Users mailing list 
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Net::Telnet

2005-06-01 Thread Peter Eisengrein

 Hi,
  I am using this module (Net::Telnet) downloaded from CPAN, 
 for a small
 interactive program in which I telnet to a particular host, 
 login and give
 some commands (based on the options you get). I am not able 
 to do this. I am
 able to login but whatever I do after that doesn't seem to happen. Can
 someone suggest what might be going wrong!!!
 
 After login, the control console shows
 
 --- Control Console
 ---
 
  1- Device Manager
  2- Network
  3- System
  4- Logout
 
  ESC- Main Menu, ENTER- Refresh, CTRL-L- Event Log
 
 


You have to reset the Prompt. It is expecting and waiting for a '/bash\$ $/'
prompt. You may also change the Prompt under the cmd method, in case it
changes throughout the session.



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Net::Telnet

2005-06-01 Thread Thomas, Mark - BLS CTR
When Net::Telnet doesn't do what you expect, 99% of the time it's a prompt
issue. Did you set the prompt? The default prompt works with the unix
command line, but you'll have to set it to work with your application.

I highly recommend using the debugging options; they can help you figure out
problems like these. 

-- 
Mark Thomas 
Internet Systems Architect
___
BAE SYSTEMS Information Technology 
2525 Network Place
Herndon, VA  20171  USA 



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Rajesh Vattem
 Sent: Wednesday, June 01, 2005 9:37 AM
 To: perl-win32-users@listserv.ActiveState.com
 Subject: Net::Telnet
 
 
 Hi,
  I am using this module (Net::Telnet) downloaded from CPAN, 
 for a small
 interactive program in which I telnet to a particular host, 
 login and give
 some commands (based on the options you get). I am not able 
 to do this. I am
 able to login but whatever I do after that doesn't seem to happen. Can
 someone suggest what might be going wrong!!!
 
 After login, the control console shows
 
 --- Control Console
 ---
 
  1- Device Manager
  2- Network
  3- System
  4- Logout
 
  ESC- Main Menu, ENTER- Refresh, CTRL-L- Event Log
 
 
 Please let me know your inputs.
   Test.txt 
 Thanks  Regards,
 Rajesh.
 
 
 
 **
 The information contained in this email and any attachments
 is likely to be confidential and legally privileged, and is for the
 intended recipient named above only. Any copying, 
 dissemination, disclosure of or use of this email or its 
 attachments unless authorised by us is prohibited, except 
 that you may forward this email and/or attachments to a third 
 party on a strict need to know basis. 
 
 If you have received this email in error, please notify us 
 immediately by replying to the email or by calling 
 +91-80-22297030. Please then delete this email and any full
 or partial copies of it.
 
 You as the intended recipient must be aware and accept 
 that emailis not a totally secure communications medium.
 
 Although we have taken all reasonable steps to make 
 sure this email and any attachments are free from viruses, 
 we do not (to the extent permitted by law) accept any liability 
 whatsoever for any virus infection and/or compromise of 
 security caused by this email and any attachment.
 
 No contract may be formed or documents served by you 
 on or with us by this email or any attachments unless 
 expressly agreed otherwise by us. 
 
 Any views expressed in this email or attachments by 
 an individual are not necessarily those of UbiNetics 
 India (Private) Limited.
 
 **
 
 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net::Telnet and Windows Telnet Server --- any alternatives?

2005-03-17 Thread Chris Wagner
The Hummingbird telnet works like a normal terminal but is non free.  For
scripting a telnet session I would use Expect anyway.  For a free telnet
server that is terminal like I would(and do) use Cygwin.  U can even use
bash as the shell.




--
REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =--
...ne cede males

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: net::telnet question

2004-12-30 Thread Sisyphus
[EMAIL PROTECTED] wrote:
And 2-nd question:
how to start fixed program/without params/ on windows98 box
from linux box (on a local network) ?
You can 'use IO::Socket;' on the Windows box to set up a simple server, 
and 'use IO::Socket;' on the linux box to send the start message to 
the server on the Windows box.

Cheers,
Rob
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Net::Telnet::Cisco script not waiting for prompt

2004-02-29 Thread James Brown
Hi Howard,

I have some experience in writing scripts with this excellent module, 
some of which have been used on c2500 routers.

Sometimes, I find that setting the terminal length to zero at the start 
of the script can help:

@output=$RSession-cmd(String = 'term length 0', Timeout = '3');

(you need enable mode before sending this command)

Experiment with this, but if all else fails, you could get in touch with 
the module author via his web forum:

http://nettelnetcisco.sourceforge.net/

HTH,

James.

Bullock, Howard A. wrote:

I am attempting to automate some router changes using Net::Telnet::Cisco and
having problems.
The router: IOS (tm) 2500 Software (C2500-J-L), Version 11.2(14)

The cisco module methods seem to work well for login, enable, and cmd('show
version'). I run into a problem when I issue cmd('wr'). The router returns
the following text:
Building configuration...
[OK]
As soon as the 'wr' command is sent the program continues to the end. I even
attempt to perform a backup using TFTP after the 'wr' commad. This also
seems to not wait for the prompt. My timeout for the commands is set to 40
seconds. I have used the debug dump.log and see what I think is very
strange. The 'wr' command is executed, then the TFTP command is executed,
then the response from the 'wr' is echoed.
 0x0: 5e 5a 0d 0a  63 31 39 34  6e 23 0d 0a  63 31 39 34
^Z..c194n#..c194
 0x00010: 6e 23   n#

0x0: 77 72 0d 0a wr..


0x0: 63 6f 70 79  20 72 75 6e  6e 69 6e 67  2d 63 6f 6e  copy
running-con

0x00010: 66 69 67 20  74 66 74 70  0d 0a 31 36  33 2e 32 34  fig
tftp..163.24

0x00020: 31 2e 31 35  34 2e 31 38  36 0d 0a 63  31 39 34 6e
1.154.186..c194n

0x00030: 2d 63 6f 6e  66 67 0d 0a  0d 0a 0d 0a   -confg..


 0x0: 77 72 0d 0a  42 75 69 6c  64 69 6e 67  20 63 6f 6e  wr..Building
con
 0x00010: 66 69 67 75  72 61 74 69  6f 6e 2e 2e  2e 0d 0a 5b
figuration.[
 0x00020: 4f 4b 5d 0d  0a 63 31 39  34 6e 23 63  6f 70 79 20
OK]..c194n#copy 
 0x00030: 72 75 6e 6e  69 6e 67   running

I even scrapped the cmd method and implemented:

$session-print('wr');
$session-waitfor('/\[OK\]/');
This also does not seem to way. Adding sleep 40; after the 'wr' command
and another sleep 40; after the TFTP command got the program to work. This
however is not solution. Any assistance would be greatly appreciated.
Howard A. Bullock
Global IT Infrastructure
717-810-3584
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Net::Telnet and Term Type

2003-07-21 Thread Andrew Timberlake-Newell








Normally, that cmd
would do the trick. Unfortunately, my
script needs to connect to a login without shell access, so I cant set TERM
that way on the remote (UNIX) box. The
login is given a menu from the start, and it is from that menu that I call the
program that wants to see vt100.



The local side is a WinXP
box. Setting TERM in the local XP-DOS
environment did what I expected:
nothing. Any
other ideas?



[So far, the only choice Im seeing is to
work-around by inserting an extra hopconnecting to a UNIX shell login first,
using that cmd(export
TERM=vt100) there, and then re-connecting from that shell login to my
destinationbut that is definitely not a preferred way to do this. It would be much better to go direct if
there is a way.]



-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mingbo_Wan


Try tm-cmd(export TERM=vt100)



--


I need to set the Telnet terminal
type option for a telnet connection using Net::Telnet. Does anyone know
how to do that?



My script is connecting to the
system and processing most commands just fine. (So I know it is NOT
related to my prompt setting.) The problem comes when I try to use a
program on the server that is looking to see vt100 in the Term Type, and it
seems to be seeing tvi925 instead. Ive tried looking through the docs
and Telnet.pm, but Im not sure how to go about using TELOPT_TTYPE, or even if
that is what I need to use.








Re: Net::Telnet on Win2K

2002-12-13 Thread Kevin Pendleton
John,

The problem is outlined in the Net:Telnet documentation.  The loads of 
gibberish is ANSI terminal escape characters.  I haven't worked with that 
exact telnet application, but some allow you to turn ANSI off and on

http://search.cpan.org/author/JROGERS/Net-Telnet-3.03/lib/Net/Telnet.pm

Connecting to a Remote MS-Windows Machine

By default MS-Windows doesn't come with a TELNET server. However third party 
TELNET servers are available. Unfortunately many of these servers falsely 
claim to be a TELNET server. This is especially true of the so-called 
Microsoft Telnet Server that comes installed with some newer versions 
MS-Windows.

When a TELNET server first accepts a connection, it must use the ASCII 
control characters carriage-return and line-feed to start a new line (see 
RFC854). A server like the Microsoft Telnet Server that doesn't do this, 
isn't a TELNET server. These servers send ANSI terminal escape sequences to 
position to a column on a subsequent line and to even position while writing 
characters that are adjacent to each other. Worse, when sending output these 
servers resend previously sent command output in a misguided attempt to 
display an entire terminal screen.

Connecting Net::Telnet to one of these false TELNET servers makes your job 
of parsing command output very difficult. It's better to replace a false 
TELNET server with a real TELNET server. The better TELNET servers for 
MS-Windows allow you to avoid the ANSI escapes by turning off something some 
of them call console mode.

Kevin

_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Net::Telnet on Win2K

2002-11-27 Thread Allegakoen, Justin Devanandan
--8--
When a TELNET server first accepts a connection, it must use the ASCII 
control characters carriage-return and line-feed to start a new line (see 
RFC854). A server like the Microsoft Telnet Server that doesn't do this, 
isn't a TELNET server. These servers send ANSI terminal escape sequences to 
position to a column on a subsequent line and to even position while writing

characters that are adjacent to each other. Worse, when sending output these

servers resend previously sent command output in a misguided attempt to 
display an entire terminal screen.

Connecting Net::Telnet to one of these false TELNET servers makes your job 
of parsing command output very difficult. It's better to replace a false 
TELNET server with a real TELNET server. The better TELNET servers for 
MS-Windows allow you to avoid the ANSI escapes by turning off something some

of them call console mode.
--8--

Kevin

Very informative, thanks.

Do you know of any FREE real Telnet servers, that allow you to turn off
console mode?

Just in
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Net::Telnet on Win2K

2002-11-27 Thread John Serink
Yah, yahread all that.
Question is, how do you stop the Win2K telnet server from defaulting to an ANSI 
terminal?
This is particularly worrisome as the option_send method has not yet been written for 
the Net::Telnet module so it is impossible to ask the Win2K server to change from 
inside the perl app.

I have tired the following unsuccessfully:
1. Reordered the terminal parameters setting on the Win2K telnet server box in the 
c:\winnt\system32\termcap file (this was an attempted hack as I know nothing about 
termcap files),
2. Renamed the termcap file to that tlntsvr couldn't find it which causes tlntsvr to 
exit after login,
3. Used the /y switch in the console execution entry in the registry.

At this stage of the game, I am going to give up since the option_send method is not 
up yet. Since my app simply requires me to identify whether a remote perl script 
executed successfully on the target Win2K machine, I can search through the gibberish 
with regex and check. Unfortunately, this does not solve the more general issue 
regarding the tlntsvr on a Win2K box.

Mickeysoft has ZERO information on the termcap file anywhere on their website but it 
appears to follow the Unix syntax. They also have ZERO information on how to change 
the default terminal setting for the tlntsvr.

Anyhow, That's it for me on this issue.

Cheers and thanx to everybody for the help,
jOhn

 -Original Message-
 From: Kevin Pendleton [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, November 28, 2002 12:56 PM
 To: John Serink; [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Subject: Re: Net::Telnet on Win2K
 
 
 John,
 
 The problem is outlined in the Net:Telnet documentation.  The 
 loads of 
 gibberish is ANSI terminal escape characters.  I haven't 
 worked with that 
 exact telnet application, but some allow you to turn ANSI off 
 and on
 
 http://search.cpan.org/author/JROGERS/Net-Telnet-3.03/lib/Net/
 Telnet.pm
 
 Connecting to a Remote MS-Windows Machine
 
 By default MS-Windows doesn't come with a TELNET server. 
 However third party 
 TELNET servers are available. Unfortunately many of these 
 servers falsely 
 claim to be a TELNET server. This is especially true of the so-called 
 Microsoft Telnet Server that comes installed with some 
 newer versions 
 MS-Windows.
 
 When a TELNET server first accepts a connection, it must use 
 the ASCII 
 control characters carriage-return and line-feed to start a 
 new line (see 
 RFC854). A server like the Microsoft Telnet Server that 
 doesn't do this, 
 isn't a TELNET server. These servers send ANSI terminal 
 escape sequences to 
 position to a column on a subsequent line and to even 
 position while writing 
 characters that are adjacent to each other. Worse, when 
 sending output these 
 servers resend previously sent command output in a misguided 
 attempt to 
 display an entire terminal screen.
 
 Connecting Net::Telnet to one of these false TELNET servers 
 makes your job 
 of parsing command output very difficult. It's better to 
 replace a false 
 TELNET server with a real TELNET server. The better TELNET 
 servers for 
 MS-Windows allow you to avoid the ANSI escapes by turning off 
 something some 
 of them call console mode.
 
 Kevin
 
 _
 STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
 http://join.msn.com/?page=features/junkmail
 
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: NET::Telnet

2002-09-17 Thread Thomas R Wyant_III


Jitranda,

I gave up trying to figure out what to use as a prompt for Net::Telnet when
connecting to Windows' telnet server.

Maybe someone out there will enlighten us both.

Tom




Jitendra Soam [EMAIL PROTECTED]@listserv.ActiveState.com on 09/17/2002
10:38:52 AM

Sent by:[EMAIL PROTECTED]


To:[EMAIL PROTECTED]
cc:
Subject:RE: NET::Telnet



Thanks.

But the what should be used as prompt?



-Original Message-
From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 7:01 PM
To: [EMAIL PROTECTED]
Subject: Re: NET::Telnet



Jitendra Soam [EMAIL PROTECTED] wrote:

 Is it possible to use Net::Telnet module to telnet into Windows
 machine running Microsoft Telnet Service..

In theory, yes, _provided_ the Telnet service is set up to do
username/password authentication. This is not the default.

In practice, there appear to be significant problems figuring out what
you
should tell it the prompt string is, because Microsoft embeds all sorts
of
escape sequences in it.

 and start Any program like Notepad on target machine?

In theory, yes. In practice, of course, Notepad displays on the target
machine's desktop, which probably does you as the owner of the telnet
link
no good at all.

Tom Wyant



This communication is for use by the intended recipient and contains
information that may be privileged, confidential or copyrighted under
applicable law.  If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited.  Please notify the sender
by return e-mail and delete this e-mail from your system.  Unless
explicitly and conspicuously designated as E-Contract Intended,
this e-mail does not constitute a contract offer, a contract amendment,
or an acceptance of a contract offer.  This e-mail does not constitute
a consent to the use of sender's contact information for direct
marketing
purposes or for transfers of data to third parties.

 Francais Deutsch Italiano  Espanol  Portuges  Japanese  Chinese  Korean

http://www.DuPont.com/corp/email_disclaimer.html


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs





This communication is for use by the intended recipient and contains 
information that may be privileged, confidential or copyrighted under
applicable law.  If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited.  Please notify the sender
by return e-mail and delete this e-mail from your system.  Unless
explicitly and conspicuously designated as E-Contract Intended,
this e-mail does not constitute a contract offer, a contract amendment,
or an acceptance of a contract offer.  This e-mail does not constitute
a consent to the use of sender's contact information for direct marketing
purposes or for transfers of data to third parties.

 Francais Deutsch Italiano  Espanol  Portuges  Japanese  Chinese  Korean

http://www.DuPont.com/corp/email_disclaimer.html


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: NET::Telnet

2002-09-17 Thread Carter Thompson




The Prompt is a regular expression that matches the
commandline prompt from the remote shell.  That means
you'll want to match the prompt for the user you are
logging in as.  If I log into one of my remote windows
machines through a telnet server and I see I have a 
prompt like so, C:/ I'll need to match that within
my code as prompt.

If the prompt isn't matched in the time specified in 
Timeout then the script will either return false or
die based on what Errmode is set to, return or die
respectively.  

NET::Telnet Defaults:
Timeout = 10
Host = localhost
Errmode = die
Prompt = /[\$%#]$/  # matches most unix shells.
Port = 23

This is how you could establish a connection with a 
windows machine with NET::Telnet (Untested).

use strict;

my $TIMEOUT = 30;
my $PROMPT = C:/; 
my $HOST = foobar.foo.com;
my $USER = Bob;
my $PASS = password;

$telnet = Net::Telnet-new( Timeout = $TIMEOUT,
Prompt  = $PROMPT,
Host= $HOST,
Errmode = return);

$telnet-login($USER, $PASS);

# Test here for success if using return.
my $msg = $telnet-errmsg();
if ($msg) {
print $msg\n;
$telnet-close;
# do whatever you want here.
}



Hope this helps.

Cheers,

Carter.


 -Original Message-
 From: Jitendra Soam [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 17, 2002 7:39 AM
 To: [EMAIL PROTECTED]
 Subject: RE: NET::Telnet
 
 
 
 Thanks.
 
 But the what should be used as prompt?
 
 
 
 -Original Message-
 From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, September 17, 2002 7:01 PM
 To: [EMAIL PROTECTED]
 Subject: Re: NET::Telnet
 
 
 
 Jitendra Soam [EMAIL PROTECTED] wrote:
 
  Is it possible to use Net::Telnet module to telnet into Windows
  machine running Microsoft Telnet Service..
 
 In theory, yes, _provided_ the Telnet service is set up to do
 username/password authentication. This is not the default.
 
 In practice, there appear to be significant problems figuring out what
 you
 should tell it the prompt string is, because Microsoft embeds 
 all sorts
 of
 escape sequences in it.
 
  and start Any program like Notepad on target machine?
 
 In theory, yes. In practice, of course, Notepad displays on the target
 machine's desktop, which probably does you as the owner of the telnet
 link
 no good at all.
 
 Tom Wyant
 
 
 
 This communication is for use by the intended recipient and contains 
 information that may be privileged, confidential or copyrighted under
 applicable law.  If you are not the intended recipient, you are hereby
 formally notified that any use, copying or distribution of 
 this e-mail,
 in whole or in part, is strictly prohibited.  Please notify the sender
 by return e-mail and delete this e-mail from your system.  Unless
 explicitly and conspicuously designated as E-Contract Intended,
 this e-mail does not constitute a contract offer, a contract 
 amendment,
 or an acceptance of a contract offer.  This e-mail does not constitute
 a consent to the use of sender's contact information for direct
 marketing
 purposes or for transfers of data to third parties.
 
  Francais Deutsch Italiano  Espanol  Portuges  Japanese  
 Chinese  Korean
 
 http://www.DuPont.com/corp/email_disclaimer.html
 
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: NET::Telnet

2002-09-17 Thread Carter Thompson



Before anyone else mentions it - please add the
use NET::Telnet in the example.

I told you it was untested.  ;-)

Carter.

 -Original Message-
 From: Carter Thompson 
 Sent: Tuesday, September 17, 2002 10:22 AM
 To: Jitendra Soam; [EMAIL PROTECTED]
 Subject: RE: NET::Telnet
 
 
 
 
 
 The Prompt is a regular expression that matches the
 commandline prompt from the remote shell.  That means
 you'll want to match the prompt for the user you are
 logging in as.  If I log into one of my remote windows
 machines through a telnet server and I see I have a 
 prompt like so, C:/ I'll need to match that within
 my code as prompt.
 
 If the prompt isn't matched in the time specified in 
 Timeout then the script will either return false or
 die based on what Errmode is set to, return or die
 respectively.  
 
 NET::Telnet Defaults:
 Timeout = 10
 Host = localhost
 Errmode = die
 Prompt = /[\$%#]$/  # matches most unix shells.
 Port = 23
 
 This is how you could establish a connection with a 
 windows machine with NET::Telnet (Untested).
 
 use strict;
 
 my $TIMEOUT = 30;
 my $PROMPT = C:/;   
 my $HOST = foobar.foo.com;
 my $USER = Bob;
 my $PASS = password;
 
 $telnet = Net::Telnet-new( Timeout = $TIMEOUT,
   Prompt  = $PROMPT,
   Host= $HOST,
   Errmode = return);
 
 $telnet-login($USER, $PASS);
 
 # Test here for success if using return.
 my $msg = $telnet-errmsg();
 if ($msg) {
   print $msg\n;
   $telnet-close;
   # do whatever you want here.
 }
 
 
 
 Hope this helps.
 
 Cheers,
 
 Carter.
 
 
  -Original Message-
  From: Jitendra Soam [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, September 17, 2002 7:39 AM
  To: [EMAIL PROTECTED]
  Subject: RE: NET::Telnet
  
  
  
  Thanks.
  
  But the what should be used as prompt?
  
  
  
  -Original Message-
  From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, September 17, 2002 7:01 PM
  To: [EMAIL PROTECTED]
  Subject: Re: NET::Telnet
  
  
  
  Jitendra Soam [EMAIL PROTECTED] wrote:
  
   Is it possible to use Net::Telnet module to telnet into Windows
   machine running Microsoft Telnet Service..
  
  In theory, yes, _provided_ the Telnet service is set up to do
  username/password authentication. This is not the default.
  
  In practice, there appear to be significant problems 
 figuring out what
  you
  should tell it the prompt string is, because Microsoft embeds 
  all sorts
  of
  escape sequences in it.
  
   and start Any program like Notepad on target machine?
  
  In theory, yes. In practice, of course, Notepad displays on 
 the target
  machine's desktop, which probably does you as the owner of 
 the telnet
  link
  no good at all.
  
  Tom Wyant
  
  
  
  This communication is for use by the intended recipient and 
 contains 
  information that may be privileged, confidential or 
 copyrighted under
  applicable law.  If you are not the intended recipient, you 
 are hereby
  formally notified that any use, copying or distribution of 
  this e-mail,
  in whole or in part, is strictly prohibited.  Please notify 
 the sender
  by return e-mail and delete this e-mail from your system.  Unless
  explicitly and conspicuously designated as E-Contract Intended,
  this e-mail does not constitute a contract offer, a contract 
  amendment,
  or an acceptance of a contract offer.  This e-mail does not 
 constitute
  a consent to the use of sender's contact information for direct
  marketing
  purposes or for transfers of data to third parties.
  
   Francais Deutsch Italiano  Espanol  Portuges  Japanese  
  Chinese  Korean
  
  http://www.DuPont.com/corp/email_disclaimer.html
  
  
  ___
  Perl-Win32-Users mailing list
  [EMAIL PROTECTED]
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
  ___
  Perl-Win32-Users mailing list
  [EMAIL PROTECTED]
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
  
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: NET::Telnet

2002-09-17 Thread Story, Lenny

Greetings,

I too had alot of trouble getting Net::Telnet to work properly,
it seemed to continuously stop for no apparent reason, with very 
poor performance. As well as not being able to make it non-block
on win32.

I had to eventually write a direct TCP client to get a proper
level of performance..etc..

Just my .02,
-Lenny 

-Original Message-
From: Moulder, Glen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 1:42 PM
To: perl-win32-users
Subject: FW: NET::Telnet



Carter, what you're saying may work on Unix systems, but after 2 weeks of
hair-pulling last year, I gave up trying to use Net::Telnet on legacy Univac
and Dec systems.  The module just couldn't handle the odd terminal emulation
escape sequences that were being fed to it (especially on the Univac) and I
was unable to reliably establish and maintain terminal sessions on those
machines.  Finally had to brute force ftp files up to those boxes without
being able to do the file existence/status checking planned for in my
original design.  Net::Telnet users beware.

Glen


-Original Message-
From: Carter Thompson [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 17, 2002 1:22 PM
To: Jitendra Soam; [EMAIL PROTECTED]
Subject: RE: NET::Telnet





The Prompt is a regular expression that matches the
commandline prompt from the remote shell.  That means
you'll want to match the prompt for the user you are
logging in as.  If I log into one of my remote windows
machines through a telnet server and I see I have a 
prompt like so, C:/ I'll need to match that within
my code as prompt.

If the prompt isn't matched in the time specified in 
Timeout then the script will either return false or
die based on what Errmode is set to, return or die respectively.  

NET::Telnet Defaults:
Timeout = 10
Host = localhost
Errmode = die
Prompt = /[\$%#]$/  # matches most unix shells.
Port = 23

This is how you could establish a connection with a 
windows machine with NET::Telnet (Untested).

use strict;

my $TIMEOUT = 30;
my $PROMPT = C:/; 
my $HOST = foobar.foo.com;
my $USER = Bob;
my $PASS = password;

$telnet = Net::Telnet-new( Timeout = $TIMEOUT,
Prompt  = $PROMPT,
Host= $HOST,
Errmode = return);

$telnet-login($USER, $PASS);

# Test here for success if using return.
my $msg = $telnet-errmsg();
if ($msg) {
print $msg\n;
$telnet-close;
# do whatever you want here.
}



Hope this helps.

Cheers,

Carter.


 -Original Message-
 From: Jitendra Soam [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 17, 2002 7:39 AM
 To: [EMAIL PROTECTED]
 Subject: RE: NET::Telnet
 
 
 
 Thanks.
 
 But the what should be used as prompt?
 
 
 
 -Original Message-
 From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 17, 2002 7:01 PM
 To: [EMAIL PROTECTED]
 Subject: Re: NET::Telnet
 
 
 
 Jitendra Soam [EMAIL PROTECTED] wrote:
 
  Is it possible to use Net::Telnet module to telnet into Windows 
  machine running Microsoft Telnet Service..
 
 In theory, yes, _provided_ the Telnet service is set up to do 
 username/password authentication. This is not the default.
 
 In practice, there appear to be significant problems figuring 
out what 
 you should tell it the prompt string is, because Microsoft embeds
 all sorts
 of
 escape sequences in it.
 
  and start Any program like Notepad on target machine?
 
 In theory, yes. In practice, of course, Notepad displays on 
the target 
 machine's desktop, which probably does you as the owner of the telnet 
 link no good at all.
 
 Tom Wyant
 
 
 
 This communication is for use by the intended recipient and contains
 information that may be privileged, confidential or copyrighted under
 applicable law.  If you are not the intended recipient, you are hereby
 formally notified that any use, copying or distribution of 
 this e-mail,
 in whole or in part, is strictly prohibited.  Please notify the sender
 by return e-mail and delete this e-mail from your system.  Unless
 explicitly and conspicuously designated as E-Contract Intended,
 this e-mail does not constitute a contract offer, a contract 
 amendment,
 or an acceptance of a contract offer.  This e-mail does not constitute
 a consent to the use of sender's contact information for direct
 marketing
 purposes or for transfers of data to third parties.
 
  Francais Deutsch Italiano  Espanol  Portuges  Japanese
 Chinese  Korean
 
 http://www.DuPont.com/corp/email_disclaimer.html
 
 
 ___
 Perl-Win32-Users mailing list 
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 ___
 Perl-Win32-Users mailing list 
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
___
Perl-Win32-Users mailing list

RE: NET::Telnet

2002-09-17 Thread John Serink

First, if you are telnetting from a non Windoze PC, you must turn off NTLM 
authentication on the host.
This works on an NT box:
use Net::Telnet;
use strict;
use warnings;

my $telnet = new Net::Telnet ( Timeout=10, Errmode='die');
my @jim=;
my $frank=;
$telnet-open('192.168.174.108');
$telnet-waitfor('/Username: $/i');
$telnet-print('Administrator');
$telnet-waitfor('/Password: $/i');
$telnet-print('12345');
$telnet-waitfor('/\$/i');
$telnet-print('show users');
@jim=$telnet-waitfor('/\$/');

Its similar for W2K except that Username is login.

 -Original Message-
 From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 18, 2002 12:20 AM
 To: [EMAIL PROTECTED]
 Subject: RE: NET::Telnet
 
 
 
 Jitranda,
 
 I gave up trying to figure out what to use as a prompt for 
 Net::Telnet when
 connecting to Windows' telnet server.
 
 Maybe someone out there will enlighten us both.
 
 Tom
 
 
 
 
 Jitendra Soam [EMAIL PROTECTED]@listserv.ActiveState.com 
 on 09/17/2002
 10:38:52 AM
 
 Sent by:[EMAIL PROTECTED]
 
 
 To:[EMAIL PROTECTED]
 cc:
 Subject:RE: NET::Telnet
 
 
 
 Thanks.
 
 But the what should be used as prompt?
 
 
 
 -Original Message-
 From: Thomas R Wyant_III [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 17, 2002 7:01 PM
 To: [EMAIL PROTECTED]
 Subject: Re: NET::Telnet
 
 
 
 Jitendra Soam [EMAIL PROTECTED] wrote:
 
  Is it possible to use Net::Telnet module to telnet into Windows
  machine running Microsoft Telnet Service..
 
 In theory, yes, _provided_ the Telnet service is set up to do
 username/password authentication. This is not the default.
 
 In practice, there appear to be significant problems figuring out what
 you
 should tell it the prompt string is, because Microsoft embeds 
 all sorts
 of
 escape sequences in it.
 
  and start Any program like Notepad on target machine?
 
 In theory, yes. In practice, of course, Notepad displays on the target
 machine's desktop, which probably does you as the owner of the telnet
 link
 no good at all.
 
 Tom Wyant
 
 
 
 This communication is for use by the intended recipient and contains
 information that may be privileged, confidential or copyrighted under
 applicable law.  If you are not the intended recipient, you are hereby
 formally notified that any use, copying or distribution of 
 this e-mail,
 in whole or in part, is strictly prohibited.  Please notify the sender
 by return e-mail and delete this e-mail from your system.  Unless
 explicitly and conspicuously designated as E-Contract Intended,
 this e-mail does not constitute a contract offer, a contract 
 amendment,
 or an acceptance of a contract offer.  This e-mail does not constitute
 a consent to the use of sender's contact information for direct
 marketing
 purposes or for transfers of data to third parties.
 
  Francais Deutsch Italiano  Espanol  Portuges  Japanese  
 Chinese  Korean
 
 http://www.DuPont.com/corp/email_disclaimer.html
 
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
 
 
 
 
 This communication is for use by the intended recipient and contains 
 information that may be privileged, confidential or copyrighted under
 applicable law.  If you are not the intended recipient, you are hereby
 formally notified that any use, copying or distribution of 
 this e-mail,
 in whole or in part, is strictly prohibited.  Please notify the sender
 by return e-mail and delete this e-mail from your system.  Unless
 explicitly and conspicuously designated as E-Contract Intended,
 this e-mail does not constitute a contract offer, a contract 
 amendment,
 or an acceptance of a contract offer.  This e-mail does not constitute
 a consent to the use of sender's contact information for 
 direct marketing
 purposes or for transfers of data to third parties.
 
  Francais Deutsch Italiano  Espanol  Portuges  Japanese  
 Chinese  Korean
 
 http://www.DuPont.com/corp/email_disclaimer.html
 
 
 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: net::telnet

2001-04-11 Thread Ted W.

I have no familiarity with the Net::Telnet module, but I believe the SU
syntax is
actually 'SU -' to open a shell that you can log into.

TW

On Wed, 11 Apr 2001, John Williams wrote:

 I've had success with the Net::Telnet module.  But I can't get the SU
 command to work.  It times out waiting for a password.

 Any ideas?

 Thanks!

 John

 ---CODE
 #! perl remote login
 use Net::Telnet ();
 $telnet = new Net::Telnet (Timeout = 5);

 $telnet-open("192.134.1.23");
 $telnet-login($user, $pw);

 $telnet-cmd("su");

 #it never seems to get to this point
 $telnet-waitfor('/Password: /');
 $telnet-print("the password");





___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: net::telnet

2001-04-11 Thread Ron Grabowski




   $telnet-cmd("su");
  
  su should require a password so normal users cannot 
  arbitrarly becomeroot.