line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::BSD::Drives; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
91771845
|
use strict; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
425
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
123
|
|
7
|
1
|
|
|
1
|
|
414
|
use FusionInventory::Agent::Tools::Unix; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
214
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{drive}; |
12
|
0
|
|
|
|
|
|
return canRun('df'); |
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
|
|
|
|
|
|
|
# get filesystem types |
22
|
|
|
|
|
|
|
my @types = |
23
|
0
|
|
|
|
|
|
grep { ! /^(?:fdesc|devfs|procfs|linprocfs|linsysfs|tmpfs|fdescfs)$/ } |
|
0
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
getFilesystemsTypesFromMount(logger => $logger); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# get filesystem for each type |
27
|
0
|
|
|
|
|
|
my @filesystems; |
28
|
0
|
|
|
|
|
|
foreach my $type (@types) { |
29
|
0
|
|
|
|
|
|
push @filesystems, getFilesystemsFromDf( |
30
|
|
|
|
|
|
|
logger => $logger, |
31
|
|
|
|
|
|
|
command => "df -P -k -t $type", |
32
|
|
|
|
|
|
|
type => $type |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# add filesystems to the inventory |
37
|
0
|
|
|
|
|
|
foreach my $filesystem (@filesystems) { |
38
|
0
|
|
|
|
|
|
$inventory->addEntry( |
39
|
|
|
|
|
|
|
section => 'DRIVES', |
40
|
|
|
|
|
|
|
entry => $filesystem |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |