in reply to Net::Telnet timed out when logging in
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");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::Telnet timed out when logging in
by regexes (Hermit) on Apr 18, 2008 at 06:36 UTC | |
by poolboi (Acolyte) on Apr 18, 2008 at 06:40 UTC | |
by regexes (Hermit) on Apr 18, 2008 at 06:53 UTC | |
by poolboi (Acolyte) on Apr 18, 2008 at 07:44 UTC | |
by poolboi (Acolyte) on Apr 18, 2008 at 08:33 UTC | |
by regexes (Hermit) on Apr 18, 2008 at 09:07 UTC | |
by glide (Pilgrim) on Apr 18, 2008 at 09:14 UTC | |
|
Re^2: Net::Telnet timed out when logging in
by poolboi (Acolyte) on Apr 18, 2008 at 03:26 UTC |