line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::HPUX::MP; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
71315735
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
59
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
388
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
133
|
|
7
|
1
|
|
|
1
|
|
375
|
use FusionInventory::Agent::Tools::Network; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
296
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#TODO driver pcislot virtualdev |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub isEnabled { |
12
|
|
|
|
|
|
|
return |
13
|
0
|
|
0
|
0
|
0
|
|
canRun('/opt/hpsmh/data/htdocs/comppage/getMPInfo.cgi') || |
14
|
|
|
|
|
|
|
canRun('/opt/sfm/bin/CIMUtil'); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub doInventory { |
18
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
21
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
my $ipaddress = canRun('/opt/hpsmh/data/htdocs/comppage/getMPInfo.cgi') ? |
24
|
|
|
|
|
|
|
_parseGetMPInfo(logger => $logger) : _parseCIMUtil(logger => $logger); |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$inventory->addEntry( |
27
|
|
|
|
|
|
|
section => 'NETWORKS', |
28
|
|
|
|
|
|
|
entry => { |
29
|
|
|
|
|
|
|
DESCRIPTION => 'Management Interface - HP MP', |
30
|
|
|
|
|
|
|
TYPE => 'Ethernet', |
31
|
|
|
|
|
|
|
MANAGEMENT => 'MP', |
32
|
|
|
|
|
|
|
IPADDRESS => $ipaddress, |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _parseGetMPInfo { |
39
|
0
|
|
|
0
|
|
|
return getFirstMatch( |
40
|
|
|
|
|
|
|
command => '/opt/hpsmh/data/htdocs/comppage/getMPInfo.cgi', |
41
|
|
|
|
|
|
|
pattern => qr{RIBLink = "https?://($ip_address_pattern)";}, |
42
|
|
|
|
|
|
|
@_ |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _parseCIMUtil { |
47
|
0
|
|
|
0
|
|
|
return getFirstMatch( |
48
|
|
|
|
|
|
|
command => '/opt/sfm/bin/CIMUtil -e root/cimv2 HP_ManagementProcessor', |
49
|
|
|
|
|
|
|
pattern => qr{^IPAddress\s+:\s+($ip_address_pattern)}, |
50
|
|
|
|
|
|
|
@_ |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |