line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Win32::Slots; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
57093730
|
use strict; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
68
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
498
|
use FusionInventory::Agent::Tools::Win32; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
200
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my %status = ( |
9
|
|
|
|
|
|
|
3 => 'free', |
10
|
|
|
|
|
|
|
4 => 'used' |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub isEnabled { |
14
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
15
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{slot}; |
16
|
0
|
|
|
|
|
|
return 1; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub doInventory { |
20
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
foreach my $object (getWMIObjects( |
25
|
|
|
|
|
|
|
class => 'Win32_SystemSlot', |
26
|
|
|
|
|
|
|
properties => [ qw/Name Description SlotDesignation CurrentUsage/ ] |
27
|
|
|
|
|
|
|
)) { |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$inventory->addEntry( |
30
|
|
|
|
|
|
|
section => 'SLOTS', |
31
|
|
|
|
|
|
|
entry => { |
32
|
|
|
|
|
|
|
NAME => $object->{Name}, |
33
|
|
|
|
|
|
|
DESCRIPTION => $object->{Description}, |
34
|
|
|
|
|
|
|
DESIGNATION => $object->{SlotDesignation}, |
35
|
|
|
|
|
|
|
STATUS => $status{$object->{CurrentUsage}} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |