
vaviad
New User
Aug 15, 2011, 2:26 AM
Post #1 of 1
(21500 views)
|
Problem with Telnet to windows 64bit
|
Can't Post
|
|
Hi, I have some problem to telnet to Windows 64BIT, same script works just fine on windows 32 bit. I use telnet.pm module my function is: sub OpenTelnetConectionWindows { my $lh_ref = shift; my $host_ref = shift; my $Account_ref= shift; my $AccountPass_ref = shift; my $TelnetLifeCheck; my $this_subs_name = (caller(0))[3]; $$lh_ref->log("Function: $this_subs_name"); $$lh_ref->log_print("Open Telnet Conection on $$host_ref on account $$Account_ref."); my $telnet = new Net::Telnet ( Timeout => 20000, Prompt => '/[\w().-]*[\$#>:.]\s?(?:\(enable\))?\s*$/', #Prompt => '/(?m:^[\w.&-]+\s?(?:\(config[^\)]*\))?\s?[\$#>]\s?(?:\(enable\))?\s*$)/', #Prompt => '/C:\\\\>$/i', Dump_log => 'dump.log', Input_log => 'InputLog.txt', Output_log => 'OutputLog.txt' ); $telnet->open("$$host_ref"); $telnet->waitfor('/\d*[Ll]ogin:\s*/'); #$telnet->waitfor('/login: $/i'); $telnet->print($$Account_ref); $telnet->waitfor('/\d*[Pp]assword:\s*/'); #$telnet->waitfor('/password: $/i'); $telnet->print($$AccountPass_ref); my $str = 'hostname'; my @tmp = $telnet->cmd($str); print @tmp; return $telnet; } i get error message: pattern match read eof at D:\Documents and.... then i add this lines: my $str = 'hostname'; $telnet->errmode(sub {die @_ unless $_[0] =~ /eof/}); $telnet->errmode(); my @tmp = $telnet->cmd($str); print @tmp; but i dont get any prints, but when i try to print again i get: write error: filehandle isn't open at D:\Documents and than mean that telnet connection doesn't open i work with input and dump log but i can't understand where i get wrong... this function work on windows 32 bit. Any suggestions? Thanks Aviad
(This post was edited by vaviad on Aug 16, 2011, 1:19 AM)
|