Re: Net::Telnet

2008-08-13 Thread Hashmat Khan
> >>> I get this error: > >>> maximum input buffer length exceeded: 1048576 bytes at D:\Docs\Perl > >>> \scripts\ > >>> ti_p2k_bld.pl line 33 > > >>> This could be because $prematch is gets a very big string and so it > >>> exceeds the limit which I had suspected before. > >>> Bottomline, I want t

Re: Net::Telnet

2008-08-11 Thread Rob Dixon
Hashmat Khan wrote: > On Mon, Aug 11, 2008 at 9:00 PM, Rob Dixon <[EMAIL PROTECTED] PROTECTED]>> wrote: >> Hashmat Khan wrote: >>> >>> For the timeout, I used a very large value, so its solved ! >>> >>> One more issue, when I use this: >>> >>> @lines = $t->cmd($bldcmd) >>> ($pre

Re: Net::Telnet

2008-08-11 Thread Rob Dixon
Hashmat Khan wrote: > > For the timeout, I used a very large value, so its solved ! > > One more issue, when I use this: > > @lines = $t->cmd($bldcmd) > ($prematch, $match) = $t->waitfor(Match => /Build completed on/ || / > Build failed on/); > > I get this error: > maximum input buffer lengt

Re: Net::Telnet

2008-08-11 Thread Hashmat Khan
Hello All, For the timeout, I used a very large value, so its solved ! One more issue, when I use this: @lines = $t->cmd($bldcmd) ($prematch, $match) = $t->waitfor(Match => /Build completed on/ || / Build failed on/); I get this error: maximum input buffer length exceeded: 1048576 bytes at D:

Re: Net::Telnet

2008-08-07 Thread Hashmat Khan
Hi, The only issue I have now is with timeout, and how do I disable this ? thanks, Hashmat On Thu, Aug 7, 2008 at 7:07 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Hashmat Khan wrote: > > > > ok.. the latest on this... > > when I try cmd for certain commands, it doesn't work. > > But looks like p

Re: Net::Telnet

2008-08-07 Thread Hashmat Khan
ok, finally I got it ! cmd works, actually I had to remove the Prompt from the object creation, because some of the commands change the prompt and that is why it was timing out. Anyway, I have one last problem now, 'Timeout' , by default the value is 10 seconds, How do I get rid of it ? The perl d

Re: Net::Telnet

2008-08-07 Thread Hashmat Khan
On Aug 5, 2:52 pm, [EMAIL PROTECTED] (Hashmat Khan) wrote: > Hello Rob, > > Thanks for the reply. > Yes, I am using  Net::Telnet. And I am new to perl, I was not aware if there > are other methods to start telnet using perl. > I did as you suggested. It worked but not completely as I wanted the out

Re: Net::Telnet

2008-08-07 Thread Hashmat Khan
And when I use print, it doesn't work, I don't see any output, but if I use I see the output, but it times out(command timed out). thanks. On Aug 5, 2:52 pm, [EMAIL PROTECTED] (Hashmat Khan) wrote: > Hello Rob, > > Thanks for the reply. > Yes, I am using  Net::Telnet. And I am new to perl, I was n

Re: Net::Telnet

2008-08-07 Thread Hashmat Khan
ok. I figured out that giving Input_log => \*STDOUT works and it gives the correct output as desired. But the $t->cmd() doesn't work for certain commands. Like for ls, whoami it works, but for certain commands which change the command prompt, it doesn't work, like setting a clearcase view, anybo

Re: Net::Telnet

2008-08-07 Thread Rob Dixon
Hashmat Khan wrote: > > ok.. the latest on this... > when I try cmd for certain commands, it doesn't work. > But looks like print works, but I don't see any output(Input_log => > \*STDOUT). So I can't verify my commands in print. How do we print the > output of print ? Please try to remember to b

Re: Net::Telnet

2008-08-07 Thread Hashmat Khan
ok.. the latest on this... when I try cmd for certain commands, it doesn't work. But looks like print works, but I don't see any output(Input_log => \*STDOUT). So I can't verify my commands in print. How do we print the output of print ? On Aug 5, 2:52 pm, [EMAIL PROTECTED] (Hashmat Khan) wrote:

Re: Net::Telnet

2008-08-05 Thread Hashmat Khan
Hello Rob, Thanks for the reply. Yes, I am using Net::Telnet. And I am new to perl, I was not aware if there are other methods to start telnet using perl. I did as you suggested. It worked but not completely as I wanted the output. use Net::Telnet (); $t = new Net::Telnet (Timeout => 10,

Re: Net::Telnet

2008-08-04 Thread aditya
Hi, If I am getting you right means you want to display on Console. for that use this. ---CODE--- my $telnet = Net::Telnet->new(HOST); $telnet->login(USER,PASS) my @display = $telnet ->cmd('ls -l'); print @display; --Code-- On Aug 4, 7:47 am, [EMAIL PROTECTED] (Hashmat Khan

Re: Net::Telnet

2008-08-04 Thread aditya
Hi Hashmat, If I am getting you correclty then use this: CODE- $telnet = Net::Telnet->new(HOST); $telnet->login(USER,PASS) @display = $telnet ->cmd('ls -l'); print @display; CODE On Aug 4, 11:33 am, [EMAIL PROTECTED] (Jm) wrote: > IO::Tee allows STDOUT as o

Re: Net::Telnet

2008-08-04 Thread Rob Dixon
John W. Krahn wrote: > Rob Dixon wrote: >> Hashmat Khan wrote: >>> Has anybody used Telnet ? >>> >>> I want to know, how can we redirect the output to STDOUT instead of >>> log file ? (Dump_Log => "dump.txt") >> It's important to tell us exactly what module you're using. > > See the Subject line

Re: Net::Telnet

2008-08-04 Thread John W. Krahn
Rob Dixon wrote: Hashmat Khan wrote: Has anybody used Telnet ? I want to know, how can we redirect the output to STDOUT instead of log file ? (Dump_Log => "dump.txt") It's important to tell us exactly what module you're using. See the Subject line. :-) John -- Perl isn't a toolbox, but

Re: Net::Telnet

2008-08-04 Thread Rob Dixon
Hashmat Khan wrote: > > Has anybody used Telnet ? > > I want to know, how can we redirect the output to STDOUT instead of > log file ? (Dump_Log => "dump.txt") It's important to tell us exactly what module you're using. Telnet is a comms protocol but I don't think you mean that. There is no P

Re: Net::Telnet

2008-08-04 Thread jm
IO::Tee allows STDOUT as one of your output options On Mon, Aug 4, 2008 at 9:47 AM, Hashmat Khan <[EMAIL PROTECTED]> wrote: > Hi, > > Has anybody used Telnet ? > > I want to know, how can we redirect the output to STDOUT instead of > log file ? (Dump_Log => "dump.txt") > > thanks, > Hashmat > >

Re: Net::Telnet - Variable in Prompt

2007-06-12 Thread Chas Owens
On 6/12/07, Lakshmi Sailaja <[EMAIL PROTECTED]> wrote: snip $sub = "xyz"; $prompt = "L:\\$sub"; my $t = Net::Telnet->new( Timeout => 10, Prompt => "/$prompt/" ); snip from perldoc Net::Telnet What To Know Before Using · When constructing the match operator argume

RE: Net::Telnet - Variable in Prompt

2007-06-12 Thread Lakshmi Sailaja
essage- From: Chas Owens [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 3:29 PM To: [EMAIL PROTECTED] Cc: Martin Barth; beginners@perl.org Subject: Re: Net::Telnet - Variable in Prompt On 6/12/07, Lakshmi Sailaja <[EMAIL PROTECTED]> wrote: > But it did not work. I was getting the b

Re: Net::Telnet - Variable in Prompt

2007-06-12 Thread Chas Owens
On 6/12/07, Lakshmi Sailaja <[EMAIL PROTECTED]> wrote: But it did not work. I was getting the below error: "timed-out waiting for command prompt at line " snip This code works for me. #!/usr/bin/perl use strict; use warnings; use Net::Telnet; #my propmt is /home/user> my $prompt =

RE: Net::Telnet - Variable in Prompt

2007-06-12 Thread Lakshmi Sailaja
org Cc: [EMAIL PROTECTED] Subject: Re: Net::Telnet - Variable in Prompt On Tue, 12 Jun 2007 11:56:12 -0500 "Lakshmi Sailaja" <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a way to use a variable in the Prompt parameter like the below > line? > >

Re: Net::Telnet - Variable in Prompt

2007-06-12 Thread Martin Barth
On Tue, 12 Jun 2007 11:56:12 -0500 "Lakshmi Sailaja" <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a way to use a variable in the Prompt parameter like the below > line? > > my $telnet = Net::Telnet->new([HOST => "$server",] > [PROMPT => /$prompt/,]); > > Thanks & Regards, > La

Re: Net::Telnet --help required

2007-05-17 Thread a b
Hi Jay, Thanks for your resoponse. I tried with the suggested but it failed due to timed out (j.pl) use Net::Telnet; my $t = new Net::Telnet; $t->open("slias10"); print($t->waitfor('/login:.*$/')); $t->print("root"); sleep(2); @forecast=$t->cmd("/usr/bin/ls"); print @forecast; C:\>perl j.pl HP

Re: Net::Telnet --help required

2007-05-16 Thread Jay Savage
On 5/16/07, a b <[EMAIL PROTECTED]> wrote: Hello, I am trying to telnet to all m/c for which i haven't set password(only root is a valid user) any body can telnet using root user But when i try to access through perl it use warnings; use Net::Telnet; my $t = new Net::Telnet (Timeout => 10,Promp

Re: Net::Telnet login problem

2004-06-11 Thread Wiggins d Anconia
> Hi, > I have written a web based utility that requires to login to several > machines and do some routine tasks > MY script uses Net::Telnet and works fine on most machines > I use the the login() method to login to the servers > > The problem comes when the server sometimes has a different pr

Re: Net::Telnet login problem

2004-06-10 Thread Ziggy
On Friday 11 June 2004 07:50, Ramprasad A Padmanabhan wrote: > Hi, > I have written a web based utility that requires to login to several > machines and do some routine tasks > MY script uses Net::Telnet and works fine on most machines > I use the the login() method to login to the servers > > Th

Re: Net::Telnet executing commands on remote shell after executing su

2004-05-12 Thread Wiggins d Anconia
> Hi, > > I am using Net::Telnet and getting a new shell on a remote machine > all my commands work fine > Now suppose I become root using "su" and "pass" I am not able to > execute commands on this root shell > Can anyone show me How I can do this > I believe you are going to need to use th

Re: Net::Telnet - Variable won't change

2003-08-14 Thread Jeff Westman
--- SilverFox <[EMAIL PROTECTED]> wrote: > Jeff Westman wrote: > > > > > --- SilverFox <[EMAIL PROTECTED]> wrote: > >> Hey can someone help me figure out why the value of $file_exists won't > >> change even when the file is mssing Thx. > >> > >> #!/usr/bin/perl -w > >> $out="/home/laptop/sc

Re: Net::Telnet - Variable won't change

2003-08-14 Thread Jeff Westman
--- SilverFox <[EMAIL PROTECTED]> wrote: > Hey can someone help me figure out why the value of $file_exists won't > change even when the file is mssing Thx. > > #!/usr/bin/perl -w > $out="/home/laptop/scripts/perl/logs/resetmf.log"; > open OUT, ">>$out" or die "Unable to open $out :$!"; > >

Re: Net::Telnet - Variable won't change

2003-08-14 Thread SilverFox
Jeff Westman wrote: > > --- SilverFox <[EMAIL PROTECTED]> wrote: >> Hey can someone help me figure out why the value of $file_exists won't >> change even when the file is mssing Thx. >> >> #!/usr/bin/perl -w >> $out="/home/laptop/scripts/perl/logs/resetmf.log"; >> open OUT, ">>$out" or die "

Re: Net::Telnet

2003-08-14 Thread Jan-Willem
"Silverfox" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > hey anyone know how to check if a file exists using the Telnet module? Net::Telnet allows you to make a TCP connection to a (remote) system. You should execute a remote command and check the given output to see if the fi

Re: Net::Telnet with username, no password - can't get past "password" prompt

2003-07-29 Thread Anand
"K Old" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 30, 2003 12:19 AM Subject: RE: Net::Telnet with username, no password - can't get past "password" prompt > > On 29 Jul 2003 11:06:09 -0

RE: Net::Telnet with username, no password - can't get past "password" prompt

2003-07-29 Thread K Old
On Tue, 2003-07-29 at 11:19, [EMAIL PROTECTED] wrote: > > On 29 Jul 2003 11:06:09 -0400, K Old <[EMAIL PROTECTED]> wrote: > > > Hello everyone, > > > > I'm trying to use Net::Telnet to connect to a server that has a test > > account called (appropr

RE: Net::Telnet with username, no password - can't get past "password" prompt

2003-07-29 Thread wiggins
On 29 Jul 2003 11:06:09 -0400, K Old <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I'm trying to use Net::Telnet to connect to a server that has a test > account called (appropriately) TEST. It has no password on doing a > normal telnet to the

Re: Net::Telnet -- Checking File Exists -SOLUTION

2003-03-24 Thread Jeff Westman
Perseverance pays off. Solution to checking if a file exists is to store result in a variable before it gets converted: $result = sprintf("%s", $t->cmd("test -f $testFile && print 1 || print 0")); Note: None of the following worked: $result = ! $t->cmd( "test -f $testFile ; echo $?" ); $result

Re: Net::Telnet -- Checking File Exists

2003-03-24 Thread Jeff Westman
--- Jeff Westman <[EMAIL PROTECTED]> wrote: > > my $result = ! $t->cmd( "test -f $testFile ; echo $?" ); > > Doesnt work. (makes no difference) In my question below, I should state that it always returns '1' irregardless if the file exists or not > --- "John W. Krahn" <[EMAIL PROTECTED]>

Re: Net::Telnet -- Checking File Exists

2003-03-24 Thread Jeff Westman
> my $result = ! $t->cmd( "test -f $testFile ; echo $?" ); Doesnt work. (makes no difference) --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > Jeff Westman wrote: > > > > How do you check if a file exists on a remote server using Net::Telnet ? > > > > I have tried: > > > > $testFile = "/tmp

Re: Net::Telnet -- Checking File Exists

2003-03-24 Thread John W. Krahn
Jeff Westman wrote: > > How do you check if a file exists on a remote server using Net::Telnet ? > > I have tried: > > $testFile = "/tmp/noFileExistsHere"; > > $result = $t->cmd("test -f $testFile ; print $? "); > $result = $t->cmd("test -f $testFile && print 1 || print 0"); > $result = $t->cmd

Re: NET::Telnet send cmd without response

2003-02-04 Thread Wiggins d'Anconia
David O'Dell wrote: I am having trouble sending a command wihtout waiting for a response. After I telnet in I send a command GET_STATS then the data prints out. However when I try to send the command like this: $t->cmd("GET_STATS"); it times out becasue I think it is waiting for a response, ho

Re: Net::Telnet::Cisco telnet to PIX Firewall

2002-10-03 Thread Robin Cragg
A PIX only allows telnet to the "inside" interface and you have to be listed as a trusted host (telhet ]. Can you telnet i ok yourself from that machine? If that's all ok, I would guess it's a problem with Prompt. Net::Telnet uses a pattern match to determine if it's time to send data, so whe

Re: Net::Telnet problem Timed-out waiting for command prompt

2002-08-21 Thread Felix Geerinckx
on Wed, 21 Aug 2002 11:18:54 GMT, [EMAIL PROTECTED] (Ashish Srivastava) wrote: > i am using Net::Telnet module. > it works fine for some users while for others it give this error > message: Timed-out:waiting for command prompt > I think this problem is concern with mounting of home directory of

Re: Net::Telnet question

2002-05-24 Thread drieux
On Friday, May 24, 2002, at 08:12 , Naser Ali wrote: > Hello everyone, > > I have gotten this program from the Net::Telnet readme file, but it does > not > work. When I run it it output a message which I don't understand. How can > I > give it userid and passwd for the telnet session..? > > ==

Re: Net::Telnet question

2002-05-24 Thread Felix Geerinckx
on Fri, 24 May 2002 15:12:18 GMT, Naser Ali wrote: > I have gotten this program from the Net::Telnet readme file, but it > does not work. When I run it it output a message which I don't > understand. How can I give it userid and passwd for the telnet > session..? > > [...] > $t = new Net::Telne

Re: net::telnet and read eof error

2002-03-13 Thread nyec
On Wednesday 13 March 2002 10:30 am, Craig Williams wrote: > In my first attempt at telneting into sun box from win98, i've been > receiving the error message : pattern match read eof at scriptName.pl line > xx-- where xx is the login line. Unable to resolve that error > through the usua

Re: net::telnet

2002-02-23 Thread Johannes Franken
On Sat, Feb 23, 2002 at 05:51:18PM +0530, Veeraraju_Mareddi wrote: > This is testing ports by telnetting to the ports.But in doin so it real for > 25 port only.For remaining ports ,its failed,that means Even though PORT is > opened ,TELNET is not able to Open. telnet is a tcp service, that's why

RE: net::telnet

2002-02-23 Thread Veeraraju_Mareddi
CTED] > Subject: Re: net::telnet > > On Sat, Feb 23, 2002 at 02:13:27PM +0530, Veeraraju_Mareddi wrote: > > Please see the code here. But This program terminates if one of > > them is Failed. > > It terminates because Net::Telnet->Errmode defaults to 'die'

Re: net::telnet

2002-02-23 Thread Johannes Franken
On Sat, Feb 23, 2002 at 02:13:27PM +0530, Veeraraju_Mareddi wrote: > Please see the code here. But This program terminates if one of > them is Failed. It terminates because Net::Telnet->Errmode defaults to 'die'. You should really set it to 'return'. But there are lots of other bugs in your c

Re: net::telnet

2002-02-23 Thread jbajin
This is one way I did it. The letters represent different things. X,Y,Z,T,U,Q,W-- All Host Names. Hope this Helps my @hosts= qw(X Y ZZ TT UU Q WW; my $username = "XXX"; my $passwd = ""; my $t; my $check; my @lines; my $logPath = "/home//log"; my

Re: NET::TELNET

2001-11-22 Thread Matt C.
Try to use the logging features of this module, which will almost certainly help. It'll create a nice text file for each side of the telnet session that will allow you to see what's going on. If you're running SSH on the box (probably a better idea anyhow), try the Net::SSH::Perl module, which I

Re: Net::Telnet

2001-10-27 Thread Maxim Berlin
Hello Joe, Saturday, October 27, 2001, Joe Echavarria <[EMAIL PROTECTED]> wrote: [..] JE> I think there is something missig or wrong on my JE> script. Please let me know. JE> The script should accept input from the command JE> line. JE> The script is below : JE> ### JE> #!/usr/

Re: Net::Telnet

2001-06-27 Thread Vrunda Prabhu
Matt: I have a couple of questions regarding your code below. 1. I get an error when I include the statement use Term::Readkey Should I be including anything else before it? Where is the documentation for Term::Readkey? 2. What is _stop.sh, and _start.sh referring to? Thanks very much V

Re: Net::Telnet

2001-06-23 Thread Matt Cauthorn
Here's some code that works well for us to bounce some apache instances across a cluster(obviously truncated). Notice how you stuff STDOUT from your remote call into an array that you print for output locally. This module rocks, and is (for us) blistering fast and super flexible. Also, I used Te

Re: Net::Telnet

2001-06-14 Thread Paul Dean
Hya, At 03:56 AM 15/06/2001 +0100, Kris G Findlay wrote: >i have written this script .. just supposed to log into computer on network >and start a forwarded gnome session to my Nt machine ! > >problem is i cant get the prompt to match. > >#perl script > > #!e:\perl\b

Re: Net::Telnet and context

2001-05-11 Thread Matt Cauthorn
Oh man I've gotten so used the the || setup I completely forgot about how it treats the left side as scalar. Changed the script and it worked like a champ. This will turn out to be a very useful script indeed. THANKS! ~Matt C. --- Peter Scott <[EMAIL PROTECTED]> wrote: > At 03:08 PM 5/11/01 -070

Re: Net::Telnet and context

2001-05-11 Thread Peter Scott
At 03:08 PM 5/11/01 -0700, Matt Cauthorn wrote: > my @results=$s->cmd(String=>$string,Prompt=>'/root\@.*/') || warn > $s->errmsg >,"\n"; > > print "@results\n"; > $s->close(); > } > >Here's the thing: the @results array only gives me the return value of the >comma