line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Memory; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
124514802
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
18
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
92
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
416
|
use FusionInventory::Agent::Tools; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
247
|
|
7
|
2
|
|
|
2
|
|
783
|
use FusionInventory::Agent::Tools::Generic; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
884
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
0
|
return 0 if $params{no_category}->{memory}; |
12
|
0
|
|
|
|
|
0
|
return 1; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub doInventory { |
16
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
0
|
my $inventory = $params{inventory}; |
19
|
0
|
|
|
|
|
0
|
my $logger = $params{logger}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
0
|
my $memories = _getMemories(logger => $logger); |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
0
|
return unless $memories; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
0
|
foreach my $memory (@$memories) { |
26
|
0
|
|
|
|
|
0
|
$inventory->addEntry( |
27
|
|
|
|
|
|
|
section => 'MEMORIES', |
28
|
|
|
|
|
|
|
entry => $memory |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _getMemories { |
34
|
21
|
|
|
21
|
|
6972
|
my $infos = getDmidecodeInfos(@_); |
35
|
|
|
|
|
|
|
|
36
|
21
|
|
|
|
|
253
|
my ($memories, $slot); |
37
|
|
|
|
|
|
|
|
38
|
21
|
100
|
|
|
|
64
|
if ($infos->{17}) { |
|
|
50
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
18
|
|
|
|
|
14
|
foreach my $info (@{$infos->{17}}) { |
|
18
|
|
|
|
|
49
|
|
41
|
148
|
|
|
|
|
115
|
$slot++; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Flash is 'in general' an unrelated internal BIOS storage |
44
|
|
|
|
|
|
|
# See bug: #1334 |
45
|
148
|
50
|
66
|
|
|
438
|
next if $info->{'Type'} && $info->{'Type'} =~ /Flash/i; |
46
|
|
|
|
|
|
|
|
47
|
148
|
|
|
|
|
105
|
my $manufacturer; |
48
|
148
|
100
|
100
|
|
|
540
|
if ( |
49
|
|
|
|
|
|
|
$info->{'Manufacturer'} |
50
|
|
|
|
|
|
|
&& |
51
|
|
|
|
|
|
|
( $info->{'Manufacturer'} !~ / |
52
|
|
|
|
|
|
|
Manufacturer |
53
|
|
|
|
|
|
|
| |
54
|
|
|
|
|
|
|
Undefined |
55
|
|
|
|
|
|
|
| |
56
|
|
|
|
|
|
|
None |
57
|
|
|
|
|
|
|
| |
58
|
|
|
|
|
|
|
^0x |
59
|
|
|
|
|
|
|
| |
60
|
|
|
|
|
|
|
00000 |
61
|
|
|
|
|
|
|
| |
62
|
|
|
|
|
|
|
\sDIMM |
63
|
|
|
|
|
|
|
/ix ) |
64
|
|
|
|
|
|
|
) { |
65
|
68
|
|
|
|
|
60
|
$manufacturer = $info->{'Manufacturer'}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $memory = { |
69
|
|
|
|
|
|
|
NUMSLOTS => $slot, |
70
|
|
|
|
|
|
|
DESCRIPTION => $info->{'Form Factor'}, |
71
|
|
|
|
|
|
|
CAPTION => $info->{'Locator'}, |
72
|
|
|
|
|
|
|
SPEED => $info->{'Speed'}, |
73
|
|
|
|
|
|
|
TYPE => $info->{'Type'}, |
74
|
|
|
|
|
|
|
SERIALNUMBER => $info->{'Serial Number'}, |
75
|
148
|
|
|
|
|
651
|
MEMORYCORRECTION => $infos->{16}[0]{'Error Correction Type'}, |
76
|
|
|
|
|
|
|
MANUFACTURER => $manufacturer |
77
|
|
|
|
|
|
|
}; |
78
|
|
|
|
|
|
|
|
79
|
148
|
100
|
66
|
|
|
550
|
if ($info->{'Size'} && $info->{'Size'} =~ /^(\d+) \s MB$/x) { |
80
|
46
|
|
|
|
|
81
|
$memory->{CAPACITY} = $1; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
148
|
|
|
|
|
196
|
push @$memories, $memory; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
} elsif ($infos->{6}) { |
86
|
|
|
|
|
|
|
|
87
|
3
|
|
|
|
|
5
|
foreach my $info (@{$infos->{6}}) { |
|
3
|
|
|
|
|
11
|
|
88
|
24
|
|
|
|
|
19
|
$slot++; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
my $memory = { |
91
|
|
|
|
|
|
|
NUMSLOTS => $slot, |
92
|
24
|
|
|
|
|
39
|
TYPE => $info->{'Type'}, |
93
|
|
|
|
|
|
|
}; |
94
|
|
|
|
|
|
|
|
95
|
24
|
100
|
66
|
|
|
86
|
if ($info->{'Installed Size'} && $info->{'Installed Size'} =~ /^(\d+)\s*(MB|Mbyte)/x) { |
96
|
5
|
|
|
|
|
9
|
$memory->{CAPACITY} = $1; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
24
|
|
|
|
|
27
|
push @$memories, $memory; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
21
|
|
|
|
|
74
|
return $memories; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
1; |