line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Win32::Chassis; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
60600220
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
64
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
64
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
496
|
use FusionInventory::Agent::Tools::Win32; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
210
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my @chassisType = ( |
9
|
|
|
|
|
|
|
'Unknown', |
10
|
|
|
|
|
|
|
'Other', |
11
|
|
|
|
|
|
|
'Unknown', |
12
|
|
|
|
|
|
|
'Desktop', |
13
|
|
|
|
|
|
|
'Low Profile Desktop', |
14
|
|
|
|
|
|
|
'Pizza Box', |
15
|
|
|
|
|
|
|
'Mini Tower', |
16
|
|
|
|
|
|
|
'Tower', |
17
|
|
|
|
|
|
|
'Portable', |
18
|
|
|
|
|
|
|
'Laptop', |
19
|
|
|
|
|
|
|
'Notebook', |
20
|
|
|
|
|
|
|
'Hand Held', |
21
|
|
|
|
|
|
|
'Docking Station', |
22
|
|
|
|
|
|
|
'All in One', |
23
|
|
|
|
|
|
|
'Sub Notebook', |
24
|
|
|
|
|
|
|
'Space-Saving', |
25
|
|
|
|
|
|
|
'Lunch Box', |
26
|
|
|
|
|
|
|
'Main System Chassis', |
27
|
|
|
|
|
|
|
'Expansion Chassis', |
28
|
|
|
|
|
|
|
'SubChassis', |
29
|
|
|
|
|
|
|
'Bus Expansion Chassis', |
30
|
|
|
|
|
|
|
'Peripheral Chassis', |
31
|
|
|
|
|
|
|
'Storage Chassis', |
32
|
|
|
|
|
|
|
'Rack Mount Chassis', |
33
|
|
|
|
|
|
|
'Sealed-Case PC' |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub isEnabled { |
37
|
0
|
|
|
0
|
0
|
|
return 1; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub doInventory { |
41
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
$inventory->setHardware({ |
46
|
|
|
|
|
|
|
CHASSIS_TYPE => _getChassis(logger => $params{logger}) |
47
|
|
|
|
|
|
|
}); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _getChassis { |
51
|
0
|
|
|
0
|
|
|
my (%params) = @_; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my $chassis; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
foreach my $object (getWMIObjects( |
56
|
|
|
|
|
|
|
class => 'Win32_SystemEnclosure', |
57
|
|
|
|
|
|
|
properties => [ qw/ChassisTypes/ ] |
58
|
|
|
|
|
|
|
)) { |
59
|
0
|
|
|
|
|
|
$chassis = $chassisType[$object->{ChassisTypes}->[0]]; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
return $chassis; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |