line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::BSD::i386; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
112656609
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
116
|
|
4
|
1
|
|
|
1
|
|
10
|
use warnings; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
121
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
9
|
use Config; |
|
1
|
|
|
|
|
113
|
|
|
1
|
|
|
|
|
153
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
804
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
200
|
|
9
|
1
|
|
|
1
|
|
702
|
use FusionInventory::Agent::Tools::Generic; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
382
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub isEnabled { |
12
|
0
|
|
|
0
|
0
|
|
return $Config{archname} =~ /^(i\d86|x86_64)/; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub doInventory { |
16
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
19
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# sysctl infos |
22
|
0
|
|
|
|
|
|
my $bios = { |
23
|
|
|
|
|
|
|
SMODEL => getFirstLine(command => 'sysctl -n hw.model') |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
my $cpu = { |
26
|
|
|
|
|
|
|
NAME => getFirstLine(command => 'sysctl -n hw.machine'), |
27
|
0
|
|
|
|
|
|
SPEED => (getCanonicalSpeed(split(/\s+/, $bios->{SMODEL})))[-1] |
28
|
|
|
|
|
|
|
}; |
29
|
0
|
|
|
|
|
|
my $count = getFirstLine(command => 'sysctl -n hw.ncpu'); |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
$inventory->setBios($bios); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# don't deal with CPUs if information can be computed from dmidecode |
34
|
0
|
|
|
|
|
|
my $infos = getDmidecodeInfos(logger => $logger); |
35
|
0
|
0
|
|
|
|
|
return if $infos->{4}; |
36
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
|
return if $params{no_category}->{cpu}; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
while ($count--) { |
40
|
0
|
|
|
|
|
|
$inventory->addEntry( |
41
|
|
|
|
|
|
|
section => 'CPUS', |
42
|
|
|
|
|
|
|
entry => $cpu |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |