Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: telnet waitfor problem

by chargrill (Parson)
on Apr 01, 2006 at 00:15 UTC ( #540581=note: print w/replies, xml ) Need Help??


in reply to telnet waitfor problem

Just out of idle curiousity, what happens when you perform the steps manually - in other words open your own telnet session to the target server, manually type in the commands you think you're sending via your perl script - do you see the telnet session return text matching "0 Successful"? (Apologies if I'm missing something, as I'm not familiar with Net::Telnet)

Update: I found out I have Net::Telnet installed on my local system, so a quick perusal of the docs shows:

Debugging The typical usage bug causes a time-out error because you've ma +de incorrect assumptions about what the remote side actually sends +. The easiest way to reconcile what the remote side sends with your e +xpecta- tions is to use "input_log()" or "dump_log()". "dump_log()" allows you to see the data being sent from the rem +ote side before any translation is done, while "input_log()" shows you t +he results after translation. The translation includes converting + end of line characters, removing and responding to TELNET protocol com +mands in the data stream.

Maybe $telnet->dump_log() will help you out.



--chargrill
$,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}

Replies are listed 'Best First'.
Re^2: telnet waitfor problem
by ultibuzz (Monk) on Apr 01, 2006 at 00:19 UTC
    0 Succsessfull means the command wents trough and its processed right any other return is a failure for exp 1999 Succesfull or because its an crapy damn old laggy total ... machin it just spit out some prov bla foobar text when i do it manuall mostly 0 Successful apears but somtimes 1999 or somthing else so the script basicly is working just the errormode is wrong as i get in the chatbox ;D default is DIE
    update
    my $telnet = Net::Telnet->new(Timeout => 30,Errmode => 'return'); solves the problem but thx to all of you for help

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://540581]
help
Chatterbox?
[marto]: good morning all

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2017-10-23 08:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (277 votes). Check out past polls.

    Notices?