line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::AIX::Drives; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
75929617
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
70
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
65
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
427
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
134
|
|
7
|
1
|
|
|
1
|
|
469
|
use FusionInventory::Agent::Tools::Unix; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
277
|
|
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 filesystems |
22
|
0
|
|
|
|
|
|
my @filesystems = |
23
|
|
|
|
|
|
|
getFilesystemsFromDf(logger => $logger, command => 'df -P -k'); |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $types = _getFilesystemTypes(logger => $logger); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# add filesystems to the inventory |
28
|
0
|
|
|
|
|
|
foreach my $filesystem (@filesystems) { |
29
|
0
|
|
|
|
|
|
$filesystem->{FILESYSTEM} = $types->{$filesystem->{TYPE}}; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
$inventory->addEntry( |
32
|
|
|
|
|
|
|
section => 'DRIVES', |
33
|
|
|
|
|
|
|
entry => $filesystem |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _getFilesystemTypes { |
39
|
0
|
|
|
0
|
|
|
my (%params) = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $handle = getFileHandle( |
42
|
|
|
|
|
|
|
command => 'lsfs -c', |
43
|
|
|
|
|
|
|
%params |
44
|
|
|
|
|
|
|
); |
45
|
0
|
0
|
|
|
|
|
return unless $handle; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
my $types; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# skip headers |
50
|
0
|
|
|
|
|
|
my $line = <$handle>; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
foreach my $line (<$handle>) { |
53
|
0
|
|
|
|
|
|
my ($mountpoint, undef, $type) = split(/:/, $line); |
54
|
0
|
|
|
|
|
|
$types->{$mountpoint} = $type; |
55
|
|
|
|
|
|
|
} |
56
|
0
|
|
|
|
|
|
close $handle; |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return $types; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |