ScOut3R has asked for the wisdom of the Perl Monks concerning the following question:
sub get_log { my $client = new Net::Telnet; open(LOG,">/tmp/telnet.log"); $client->dump_log("/tmp/dump.log"); $client->open($_[0]); my $prompt = '/user\@Becse/i'; $client->prompt($prompt); $client->login('user','pass'); $client->cmd('/log'); my $cmd = 'print without-paging'; my @lines = $client->cmd($cmd); $client->cmd('/'); $client->cmd('quit'); $client->close; foreach (@lines) { print LOG "$_\n"; } close(LOG); return @lines; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Telnet extract output
by tilly (Archbishop) on Jul 31, 2008 at 23:02 UTC | |
by ScOut3R (Sexton) on Aug 01, 2008 at 06:17 UTC | |
by tilly (Archbishop) on Aug 01, 2008 at 14:56 UTC | |
by ScOut3R (Sexton) on Aug 01, 2008 at 19:35 UTC | |
by tilly (Archbishop) on Aug 01, 2008 at 20:50 UTC | |
| |
|
Re: Telnet extract output
by marcussen (Pilgrim) on Aug 01, 2008 at 05:17 UTC | |
|
Re: Telnet extract output
by Anonymous Monk on Aug 01, 2008 at 08:43 UTC |