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