/[pxelator]/lib/PXElator/amt.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/amt.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 181 by dpavlin, Sun Aug 9 19:00:52 2009 UTC revision 262 by dpavlin, Wed Aug 19 11:02:15 2009 UTC
# Line 3  package amt; Line 3  package amt;
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/;
11    use Net::Ping;
12    
13  use html;  use html;
14    
15  sub info {  sub info {
16          my $amt = shift;          my ( $amt, $client_ip ) = @_;
17          my ( $passwd, $ip ) = split(/\n/, $amt);          my ( $passwd, $ip ) = split(/\s+/, $amt);
18          warn "amt $ip\n";          ( $ip, $passwd ) = ( $passwd, $ip ) if $passwd =~ m/$RE{net}{IPv4}/;
19    
20            $ip ||= $client_ip;
21    
22            my $p = Net::Ping->new;
23    
24            if ( ! $p->ping( $ip, 0.7 ) ) {
25                    return "$ip unreachable";
26            }
27    
28            warn "amt $ip ", '*' x length($passwd), "\n";
29    
30          $ENV{AMT_HOST} = $ip;          $ENV{AMT_HOST} = $ip;
31          $ENV{AMT_PASSWORD} = $passwd;          $ENV{AMT_PASSWORD} = $passwd;
# Line 22  sub info { Line 34  sub info {
34    
35          $out = qq|power: S| . Intel::AMT::RemoteControl::SystemPowerState          $out = qq|power: S| . Intel::AMT::RemoteControl::SystemPowerState
36                  . qq|<br>|                  . qq|<br>|
37                  . qq|<a href="http://$ip:16992/" target="$ip">amt</a>|                  . qq| <a href="http://$ip:16992/" target="$ip">amt</a>|
38                    . qq| <a href="http://$ip:16992/ip.htm" target="$ip">ip</a>|
39                  . qq|<br>|                  . qq|<br>|
40                  . html::pre_dump( Intel::AMT::NetworkAdministration::network_settings )                  . html::pre_dump( Intel::AMT::NetworkAdministration::network_settings )
41                  ;                  ;

Legend:
Removed from v.181  
changed lines
  Added in v.262

  ViewVC Help
Powered by ViewVC 1.1.26