line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Slots; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
151236481
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
115
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
103
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
678
|
use FusionInventory::Agent::Tools; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
432
|
|
7
|
2
|
|
|
2
|
|
1302
|
use FusionInventory::Agent::Tools::Generic; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
751
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %status = ( |
10
|
|
|
|
|
|
|
'Unknown' => undef, |
11
|
|
|
|
|
|
|
'In Use' => 'used', |
12
|
|
|
|
|
|
|
'Available' => 'free' |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub isEnabled { |
16
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
17
|
0
|
0
|
|
|
|
0
|
return 0 if $params{no_category}->{slot}; |
18
|
0
|
|
|
|
|
0
|
return 1; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub doInventory { |
22
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
0
|
my $inventory = $params{inventory}; |
25
|
0
|
|
|
|
|
0
|
my $logger = $params{logger}; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
0
|
my $slots = _getSlots(logger => $logger); |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
0
|
return unless $slots; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
0
|
foreach my $slot (@$slots) { |
32
|
0
|
|
|
|
|
0
|
$inventory->addEntry( |
33
|
|
|
|
|
|
|
section => 'SLOTS', |
34
|
|
|
|
|
|
|
entry => $slot |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _getSlots { |
40
|
19
|
|
|
19
|
|
6044
|
my $infos = getDmidecodeInfos(@_); |
41
|
|
|
|
|
|
|
|
42
|
19
|
100
|
|
|
|
246
|
return unless $infos->{9}; |
43
|
|
|
|
|
|
|
|
44
|
18
|
|
|
|
|
29
|
my $slots; |
45
|
18
|
|
|
|
|
22
|
foreach my $info (@{$infos->{9}}) { |
|
18
|
|
|
|
|
58
|
|
46
|
|
|
|
|
|
|
my $slot = { |
47
|
|
|
|
|
|
|
DESCRIPTION => $info->{'Type'}, |
48
|
|
|
|
|
|
|
DESIGNATION => $info->{'ID'}, |
49
|
|
|
|
|
|
|
NAME => $info->{'Designation'}, |
50
|
|
|
|
|
|
|
STATUS => $info->{'Current Usage'} ? |
51
|
104
|
100
|
|
|
|
555
|
$status{$info->{'Current Usage'}} : undef, |
52
|
|
|
|
|
|
|
}; |
53
|
|
|
|
|
|
|
|
54
|
104
|
|
|
|
|
212
|
push @$slots, $slot; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
18
|
|
|
|
|
68
|
return $slots; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |