I do not know the particulars of the telnet module you are using. You could change the logic of your return
foreach my $cmd_telnet (@telnet_drop) {
$telnet->print("$cmd_telnet");
if ($telnet->waitfor('/0 Successful/')){
print "$cmd_telnet \t Successful\n";
}
else {
print "$cmd_telnet \t NOT OK\n"
}
}
| [reply] [Watch: Dir/Any] [d/l] |
dosn't work returns the same error msg have no clue how i can get it to work
| [reply] [Watch: Dir/Any] |
i will try this tomorror because vpn is not working atm and let you know if it works or not.
thx for the suggestion
| [reply] [Watch: Dir/Any] |
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[$%++]}
| [reply] [Watch: Dir/Any] [d/l] [select] |
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
| [reply] [Watch: Dir/Any] |
Can you tell why it dies? What ist the error message? | [reply] [Watch: Dir/Any] |