I have this list I've read into an array line by line:
tty 81 bcain Async 01:18:35 00:02:55
tty 83 dnguyen Async 00:20:27 00:01:13
tty 85 cmandeville \
Async 03:26:22 00:00:58
tty 88 twooten Async 02:00:36 00:00:30
tty 89 jwaters Async 00:13:37 00:00:32
tty 95 epastoriza Async 00:45:29 00:00:00
The line starting with tty 85 is continued on the line after it so I'd
like to join them and close up the array. Any suggestions?
Once I get that figured out I'll be creating a cgi script which will put
this into a table. If I can get that far.
There's not much to show what I've done so far. It's built around
Net::Telnet::Cisco and performs a 'show caller' on a Cisco NAS. The
code's below with the cgi stuff commented out till I can get this
figured out.
Thanks,
Kevin
#!/usr/bin/perl
use warnings;
use strict;
use CGI qw( :standard );
use Net::Telnet::Cisco;
my $session = login();
# Execute a command
my @cmd_output = $session->cmd( 'show caller' );
$session->close;
#print header(), start_html( 'Dial-in Users' );
#print h2( "Current Users of VAURA008" );
foreach (@cmd_output) {
# next if /(Active)|(Line)/;
# next if /\\$/; # my attempt to see if I could identify the line
print $_;
}
#print end_html();
sub login {
my $session = Net::Telnet::Cisco->new( Host => 'vaura008' );
$session->login( 'kderkinderen', '********' );
# Turn off paging
my @cmd_output = $session->cmd( 'terminal length 0' );
return $session;
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]