line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::AIX::Slots; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
77463972
|
use strict; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
96
|
|
4
|
1
|
|
|
1
|
|
13
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
7
|
use List::Util qw(first); |
|
1
|
|
|
|
|
51
|
|
|
1
|
|
|
|
|
333
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
726
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
184
|
|
9
|
1
|
|
|
1
|
|
429
|
use FusionInventory::Agent::Tools::AIX; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
316
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub isEnabled { |
12
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
13
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{slot}; |
14
|
0
|
|
|
|
|
|
return canRun('lsdev'); |
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
|
|
|
|
|
|
|
# index VPD infos by AX field |
24
|
0
|
|
|
|
|
|
my %infos = |
25
|
0
|
|
|
|
|
|
map { $_->{AX} => $_ } |
26
|
0
|
|
|
|
|
|
grep { $_->{AX} } |
27
|
|
|
|
|
|
|
getLsvpdInfos(logger => $logger); |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
foreach my $slot (_getSlots( |
30
|
|
|
|
|
|
|
command => 'lsdev -Cc bus -F "name:description"', |
31
|
|
|
|
|
|
|
logger => $logger |
32
|
|
|
|
|
|
|
)) { |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
$slot->{DESCRIPTION} = $infos{$slot->{NAME}}->{YL} |
35
|
|
|
|
|
|
|
if $infos{$slot->{NAME}}; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
$inventory->addEntry( |
38
|
|
|
|
|
|
|
section => 'SLOTS', |
39
|
|
|
|
|
|
|
entry => $slot |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _getSlots { |
45
|
0
|
|
|
0
|
|
|
my $handle = getFileHandle(@_); |
46
|
0
|
0
|
|
|
|
|
return unless $handle; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
my @slots; |
50
|
0
|
|
|
|
|
|
while (my $line = <$handle>) { |
51
|
0
|
0
|
|
|
|
|
next unless $line =~ /^(.+):(.+)/; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
push @slots, { |
54
|
|
|
|
|
|
|
NAME => $1, |
55
|
|
|
|
|
|
|
DESIGNATION => $2, |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
} |
58
|
0
|
|
|
|
|
|
close $handle; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return @slots; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |