line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::BSD::Drives; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
81931604
|
use strict; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
75
|
|
4
|
1
|
|
|
1
|
|
11
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
65
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
417
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
135
|
|
7
|
1
|
|
|
1
|
|
439
|
use FusionInventory::Agent::Tools::Unix; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
274
|
|
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
|
0
|
|
|
|
|
|
my @types = |
23
|
0
|
|
|
|
|
|
grep { ! /^(?:fdesc|devfs|procfs|linprocfs|linsysfs|tmpfs|fdescfs)$/ } |
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; |