Home > Timed Out > Timed Out Waiting For Command Prompt Perl

Timed Out Waiting For Command Prompt Perl

Your prompt must match the server side prompt. use Net::Telnet; my $Telnet = new Net::Telnet; my $InHandle = $Telnet->input_log("inlog.txt"); my $OutHandle = $Telnet->output_log("outlog.txt"); my $prmpt = '/[\w().-]*[\$#>:.]\s?(?:\(enable\))?\s*$/'; $telnet = new Net::Telnet (Timeout=>40, Prompt => $prmpt, Errmode=>'die'); $telnet->open('xx.xx.xxx.xxx'); $telnet->login('user','user'); @lines= Detect ASCII-art windows made of M and S characters What would be your next deduction in this game of Minesweeper? The login method expects the remote server to prompt with a login prompt that matches either: /login[: ]*$/i /username[: ]*$/i and the password prompt must match: /password[: ]*$/i Use print() and http://3swindows.com/timed-out/timed-out-waiting-for-iokit.html

cheers, /LG Para: [email protected] "Attiah, Ibrahim A" cc: Assunto: timed-out waiting for command prompt Enviado Por: [email protected] e.com 18/11/02 10:01 ZE3 Please help. share|improve this answer edited Jun 29 '16 at 11:12 Dr.Avalanche 87511431 answered Jun 28 '16 at 18:04 jlvc05 112 add a comment| Your Answer draft saved draft discarded Sign up share|improve this answer edited Mar 4 '13 at 12:54 answered Mar 4 '13 at 10:47 dan1111 8,8231442 The switches command prompt is as follows: name_of_the_switch#, for example s-switch#. All rights reserved. http://code.activestate.com/lists/perl-win32-users/16643/

In the file infile.log I see the continuation of the command my @ config = $ telnet-> cmd ("sh run");, but the script is already beginning to run the command print If thisis not the case you will either have to convince them to change theirprompt or you should provide another regex in the Net::Telnet->new()method.--felix reply | permalink Related Discussions Prompt in As a result, I get an empty array @config.

  • Please note that I am new in PERL therefore can you please give me more details?
  • ActiveState, Komodo, ActiveState Perl Dev Kit, ActiveState Tcl Dev Kit, ActivePerl, ActivePython, and ActiveTcl are registered trademarks of ActiveState.
  • How can i get rid of this problem.You might want to check whether the command prompt of the users forwhich you get the error matches the default regex /[\$%#>] $/.

How should I respond to absurd observations from customers during software product demos? Dump176.txt is one of the switches which gave the wanted result. ActiveState, Komodo, ActiveState Perl Dev Kit, ActiveState Tcl Dev Kit, ActivePerl, ActivePython, and ActiveTcl are registered trademarks of ActiveState. In otherwords, you need to add the prompt parameter when you create the $telnet object: my $switch_name = 's-east'; my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'return', Input_Log => "infile.log", Prompt

Berghold -- Unix Professional Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg [reply] Re2: use Net::Telnet timed-out waiting for command prompt by gasho (Beadle) on Nov 17, 2005 You can see where your telnet script is failing by enabling debug mode like so: $telnet->input_log('C:\Temp\inputlog.txt'); $telnet->dump_log('C:\Temp\dumplog.txt'); Are you connecting to a UNIX system or Windows? Create A New User Node Status? The Net::Telnet POD gives some good examples "perldoc Net::Telnet".

Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework. It's evident that your command prompt changes after each selection the user makes. Doubt in Perl CGI WinXP command prompt window scrolls very slow Can't get Sudo.pm to run my command but it works from a prompt Discussion Navigation viewthread | post Discussion Overview The hang up is with the "waitfor('/required for test/i')" line (which was the "waitfor('/./i')" line in the previous post).

Here is my code #!/usr/bin/perl -w use strict; use Net::Telnet; my ($host, $port, $user, $pass, $command); ##### get host info print 'Enter host: '; chop($host = ); ##### get port info http://stackoverflow.com/questions/15199436/perl-telnet-does-not-wait-for-the-end-of-the-previous-command I've searched the net and everything I see does not work for me for some reason. That's about all I know regarding Telnet and prompts... RE: using Telnet module, having trouble passing the prompt whitshea (Programmer) (OP) 25 Sep 01 16:14 Amazingly, I changed the prompt to '/>/', and it worked.Thanks again for the help!Really appreciated!!Whitney

Please help. http://3swindows.com/timed-out/timed-out-waiting-for-a-response-from-resource-group-manager.html Browse other questions tagged perl timeout telnet or ask your own question. C.August 4th, 2007, 05:37 AMSince you are trying to match: 331 Password required for test. C.August 3rd, 2007, 06:51 AMThe /./ pattern matches any single character.

pass test 230 User test logged in. Here is what I have for code... #!/usr/bin/perl -w use strict; use Net::Telnet; my ($host, $port, $user, $pass, $command); ##### get host info print 'Enter host: '; chop($host = ); ##### How do I properly set Prompt? –Allan Sundry Mar 4 '13 at 11:20 @Flatline, you can use a regex. http://3swindows.com/timed-out/timed-out-waiting-for-a-program-to-execute-vbc-exe.html Comments to Ask Bjørn Hansen at [email protected] | Group listing | About Grokbase › Groups › Perl › beginners › August 2002 FAQ Badges Users Groups [Perl-beginners] Net::Telnet problem Timed-out waiting

PerlMonks graciously bestowed by Tim Vroom. Those methods will fail with a time-out if you don't set the prompt correctly. All other marks are property of their respective owners.

node historyNode Type: perlquestion [id://509482]Approved by blue_cowdawghelp Chatterbox? and all is quiet...

use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die'); $telnet->open('xx.xxx.xx.xxx'); $telnet->login('loginid', 'password'); print $telnet->cmd('who'); The previous code was working fine and give me the result. Join UsClose [prev in list] [next in list] [prev in thread] [next in thread] List: perl-win32-users Subject: RE: timed-out waiting for command prompt From: ibrahim

All these 11 switches are Alcatel Omni Switches and I think all of them use the same software. $telnet = new Net::Telnet (Timeout => 20, Prompt => '/[%#>] $/', dump_log => You could use '/[\w]+-switch#$/' –dan1111 Mar 4 '13 at 11:33 Might need a space in there, too: '/[\w]+-switch# $/' –dan1111 Mar 4 '13 at 11:43 Name is Close this window and log in. http://3swindows.com/timed-out/timed-out-waiting-for-network-reply-winmx.html What in the world happened with my cauliflower?

pass test 230 User test logged in. /QUOTE] This is the code that I have so far for the login... $tn->open ($host); $tn->waitfor('/remaining/i'); print 'user ', + $user; $tn->waitfor('/required for test/i'); Taxiing with one engine: Is engine #1 always used or do they switch? Custom ColorFunction for GeoGraphics plot with ReliefMap How does changing metrics help to find solutions to a partial differential equation? Thanks, Mr.

Connected to But after> that it is giving time-out error:> "timed-out waiting for command prompt at telp.pl line 12"> The code is as follows:>> use CGI;> use Net::Telnet();> print "Content-type:text/html\n\n";>>> $username="XXXXX";> $passwd="XXXXX";>> $t How do you define sequences that converge to infinity? Even when I increased the timeout or I changed the IP address, it still give the same error.

Cancel Red Flag SubmittedThank you for helping keep Tek-Tips Forums free from inappropriate posts.The Tek-Tips staff will check this out and take appropriate action. Join them; it only takes a minute: Sign up Perl telnet does not wait for the end of the previous command up vote 0 down vote favorite Perl telnet does not How can i get rid of this problem. ***************** Thanks in advance Ashish Srivastava ### Code Sample ########################## sub TelNet{ my $obj = new Net::Telnet->new(binmode=>0, Timeout=>20, Errmode=>\&err_handle, Host=>$hostname); if ( !defined How do I use this? | Other CB clients Other Users?

Join them; it only takes a minute: Sign up timed-out waiting for login prompt Telnet Perl up vote -1 down vote favorite I have a problem to log in into a I am using> the Net::Telnet module. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Thanks for the help.

Seekers of Perl Wisdom Cool Uses for Perl Meditations PerlMonks Discussion Categorized Q&A Tutorials Obfuscated Code Perl Poetry Perl News about Information? Anagram puzzle whose solution is guaranteed to make you laugh What is this blue thing in a photograph of a bright light?