apparantly no errors is out and it prints login successful. but the dump_log and input_log doesn't seem to contain any information so i'm not too sure if connection to telnet is made yet. about what i'm doing i need to connect to SQL database with another proprietary database. and this proprietary database is in a switch which i need to telnet into. it's all sorta like a automation thing that i need to help my colleges do for easy documentation. so now i need to try the first step and that's to establish a connection with telnet.. so how do i know if it's working? hope my code is correct..pls help? thanks#!/perl/bin/perl use strict; use Net::Telnet(); my $telnet; $telnet = new Net::Telnet ( Timeout=>10, Errmode=> 'return'); $telnet->open('ip_address')or die "failed to connect:$!"; $telnet->waitfor( -match => qr{ogin} ); $telnet->print("username"); $telnet->waitfor( -match => qr{assword} ); $telnet->print("password"); $telnet->input_log("C:\\log.txt"); $telnet->dump_log("c:\\dump.txt"); print("login successful");
In reply to Re: Net::Telnet timed out when logging in
by poolboi
in thread Net::Telnet timed out when logging in
by poolboi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |