line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::BSD::i386; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
84511458
|
use strict; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
88
|
|
4
|
1
|
|
|
1
|
|
13
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
78
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Config; |
|
1
|
|
|
|
|
31
|
|
|
1
|
|
|
|
|
72
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
401
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
136
|
|
9
|
1
|
|
|
1
|
|
471
|
use FusionInventory::Agent::Tools::Generic; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
243
|
|
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
|
0
|
|
|
|
|
|
my $cpu = { |
26
|
|
|
|
|
|
|
NAME => getFirstLine(command => 'sysctl -n hw.machine'), |
27
|
|
|
|
|
|
|
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; |