| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Memory; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
151897595
|
use strict; |
|
|
2
|
|
|
|
|
11
|
|
|
|
2
|
|
|
|
|
96
|
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
108
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
719
|
use FusionInventory::Agent::Tools; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
409
|
|
|
7
|
2
|
|
|
2
|
|
1409
|
use FusionInventory::Agent::Tools::Generic; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
1404
|
|
|
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
|
|
6564
|
my $infos = getDmidecodeInfos(@_); |
|
35
|
|
|
|
|
|
|
|
|
36
|
21
|
|
|
|
|
245
|
my ($memories, $slot); |
|
37
|
|
|
|
|
|
|
|
|
38
|
21
|
100
|
|
|
|
73
|
if ($infos->{17}) { |
|
|
|
50
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
18
|
|
|
|
|
27
|
foreach my $info (@{$infos->{17}}) { |
|
|
18
|
|
|
|
|
53
|
|
|
41
|
148
|
|
|
|
|
167
|
$slot++; |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Flash is 'in general' an unrelated internal BIOS storage |
|
44
|
|
|
|
|
|
|
# See bug: #1334 |
|
45
|
148
|
50
|
66
|
|
|
709
|
next if $info->{'Type'} && $info->{'Type'} =~ /Flash/i; |
|
46
|
|
|
|
|
|
|
|
|
47
|
148
|
|
|
|
|
170
|
my $manufacturer; |
|
48
|
148
|
100
|
100
|
|
|
840
|
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
|
|
|
|
|
107
|
$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
|
|
|
|
|
1121
|
MEMORYCORRECTION => $infos->{16}[0]{'Error Correction Type'}, |
|
76
|
|
|
|
|
|
|
MANUFACTURER => $manufacturer |
|
77
|
|
|
|
|
|
|
}; |
|
78
|
|
|
|
|
|
|
|
|
79
|
148
|
100
|
66
|
|
|
790
|
if ($info->{'Size'} && $info->{'Size'} =~ /^(\d+) \s MB$/x) { |
|
80
|
46
|
|
|
|
|
118
|
$memory->{CAPACITY} = $1; |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
|
|
83
|
148
|
|
|
|
|
296
|
push @$memories, $memory; |
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
} elsif ($infos->{6}) { |
|
86
|
|
|
|
|
|
|
|
|
87
|
3
|
|
|
|
|
7
|
foreach my $info (@{$infos->{6}}) { |
|
|
3
|
|
|
|
|
10
|
|
|
88
|
24
|
|
|
|
|
31
|
$slot++; |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
my $memory = { |
|
91
|
|
|
|
|
|
|
NUMSLOTS => $slot, |
|
92
|
24
|
|
|
|
|
77
|
TYPE => $info->{'Type'}, |
|
93
|
|
|
|
|
|
|
}; |
|
94
|
|
|
|
|
|
|
|
|
95
|
24
|
100
|
66
|
|
|
128
|
if ($info->{'Installed Size'} && $info->{'Installed Size'} =~ /^(\d+)\s*(MB|Mbyte)/x) { |
|
96
|
5
|
|
|
|
|
14
|
$memory->{CAPACITY} = $1; |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
24
|
|
|
|
|
48
|
push @$memories, $memory; |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
} |
|
102
|
|
|
|
|
|
|
|
|
103
|
21
|
|
|
|
|
76
|
return $memories; |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
1; |