276 |
my @c = split(/\s+/,$_); |
my @c = split(/\s+/,$_); |
277 |
if ( $#c == 5 ) { |
if ( $#c == 5 ) { |
278 |
client::save_ip_mac( $c[0], $c[3] ); |
client::save_ip_mac( $c[0], $c[3] ); |
279 |
( uc $c[3] => [ $c[0] , $c[5] ] ) |
( uc $c[3] => $c[5] ) |
280 |
} else { |
} else { |
281 |
} |
} |
282 |
} read_file('/proc/net/arp') |
} read_file('/proc/net/arp') |
287 |
print $client ok |
print $client ok |
288 |
, qq|<h2>Clients on $server::ip</h2>| |
, qq|<h2>Clients on $server::ip</h2>| |
289 |
, html::table( -6, |
, html::table( -6, |
290 |
'ip', 'mac', 'arp', 'hostname', 'deploy', 'conf', |
'ip', 'mac', 'dev', 'hostname', 'deploy', 'conf', |
291 |
map { |
map { |
292 |
my $ip = $_; |
my $ip = $_; |
293 |
my $conf = client::all_conf( $ip ); |
my $conf = client::all_conf( $ip ); |
295 |
( |
( |
296 |
qq|<a name=$ip href=/client/$ip>$ip</a>| |
qq|<a name=$ip href=/client/$ip>$ip</a>| |
297 |
, format::mac( $mac => 'html' ) |
, format::mac( $mac => 'html' ) |
298 |
, ( $arp->{$mac} ? $arp->{$mac}->[1] : '' ) |
, $arp->{$mac} |
299 |
, delete $conf->{hostname} |
, delete $conf->{hostname} |
300 |
, delete $conf->{deploy} |
, delete $conf->{deploy} |
301 |
, ( %$conf ? html::pre_dump( $conf ) : qq|<a href=/nmap?scan=$ip>nmap</a>| ) |
, ( %$conf ? html::pre_dump( $conf ) : qq|<a href=/nmap?scan=$ip>nmap</a>| ) |