line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Win32::Slots; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
77261727
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
110
|
|
4
|
1
|
|
|
1
|
|
9
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
130
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1159
|
use FusionInventory::Agent::Tools::Win32; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
249
|
|
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
|
|
|
|
|
|
|
$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
|
0
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |