line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Win32::Environment; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
49970442
|
use strict; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
85
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
64
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
445
|
use FusionInventory::Agent::Tools::Win32; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
179
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub isEnabled { |
9
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
return !$params{no_category}->{environment}; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub doInventory { |
15
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
foreach my $object (getWMIObjects( |
20
|
|
|
|
|
|
|
class => 'Win32_Environment', |
21
|
|
|
|
|
|
|
properties => [ qw/SystemVariable Name VariableValue/ ] |
22
|
|
|
|
|
|
|
)) { |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
next unless $object->{SystemVariable}; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$inventory->addEntry( |
27
|
|
|
|
|
|
|
section => 'ENVS', |
28
|
|
|
|
|
|
|
entry => { |
29
|
|
|
|
|
|
|
KEY => $object->{Name}, |
30
|
|
|
|
|
|
|
VAL => $object->{VariableValue} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |