3 |
use warnings; |
use warnings; |
4 |
use strict; |
use strict; |
5 |
|
|
6 |
use lib '/home/dpavlin/llin/Intel-AMT/lib/'; |
use lib '/srv/Intel-AMT/lib/'; |
7 |
use Intel::AMT::RemoteControl; |
use Intel::AMT::RemoteControl; |
8 |
use Intel::AMT::NetworkAdministration; |
use Intel::AMT::NetworkAdministration; |
9 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
10 |
use Regexp::Common qw/net/; |
use Regexp::Common qw/net/; |
11 |
|
use Net::Ping; |
12 |
|
|
13 |
use html; |
use html; |
14 |
|
|
17 |
my ( $passwd, $ip ) = split(/\s+/, $amt); |
my ( $passwd, $ip ) = split(/\s+/, $amt); |
18 |
( $ip, $passwd ) = ( $passwd, $ip ) if $passwd =~ m/$RE{net}{IPv4}/; |
( $ip, $passwd ) = ( $passwd, $ip ) if $passwd =~ m/$RE{net}{IPv4}/; |
19 |
|
|
20 |
|
my $p = Net::Ping->new; |
21 |
|
|
22 |
|
if ( ! $p->ping( $ip, 0.7 ) ) { |
23 |
|
return "$ip unreachable"; |
24 |
|
} |
25 |
|
|
26 |
warn "amt $ip ", '*' x length($passwd), "\n"; |
warn "amt $ip ", '*' x length($passwd), "\n"; |
27 |
|
|
28 |
$ENV{AMT_HOST} = $ip; |
$ENV{AMT_HOST} = $ip; |