line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::BSD::Drives; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
110080248
|
use strict; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
63
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
686
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
197
|
|
7
|
1
|
|
|
1
|
|
741
|
use FusionInventory::Agent::Tools::Unix; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
353
|
|
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; |