line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::AIX::Drives; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
86351051
|
use strict; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
62
|
|
4
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
66
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
371
|
use FusionInventory::Agent::Tools; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
241
|
|
7
|
2
|
|
|
2
|
|
719
|
use FusionInventory::Agent::Tools::Unix; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
481
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
0
|
return 0 if $params{no_category}->{drive}; |
12
|
0
|
|
|
|
|
0
|
return canRun('df'); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub doInventory { |
16
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
0
|
my $inventory = $params{inventory}; |
19
|
0
|
|
|
|
|
0
|
my $logger = $params{logger}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# get filesystems |
22
|
0
|
|
|
|
|
0
|
my @filesystems = |
23
|
|
|
|
|
|
|
getFilesystemsFromDf(logger => $logger, command => 'df -P -k'); |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
0
|
my $types = _getFilesystemTypes(logger => $logger); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# add filesystems to the inventory |
28
|
0
|
|
|
|
|
0
|
foreach my $filesystem (@filesystems) { |
29
|
0
|
|
|
|
|
0
|
$filesystem->{FILESYSTEM} = $types->{$filesystem->{TYPE}}; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
0
|
$inventory->addEntry( |
32
|
|
|
|
|
|
|
section => 'DRIVES', |
33
|
|
|
|
|
|
|
entry => $filesystem |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _getFilesystemTypes { |
39
|
3
|
|
|
3
|
|
8830
|
my (%params) = @_; |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
|
|
|
16
|
my $handle = getFileHandle( |
42
|
|
|
|
|
|
|
command => 'lsfs -c', |
43
|
|
|
|
|
|
|
%params |
44
|
|
|
|
|
|
|
); |
45
|
3
|
50
|
|
|
|
8
|
return unless $handle; |
46
|
|
|
|
|
|
|
|
47
|
3
|
|
|
|
|
23
|
my $types; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# skip headers |
50
|
3
|
|
|
|
|
23
|
my $line = <$handle>; |
51
|
|
|
|
|
|
|
|
52
|
3
|
|
|
|
|
18
|
foreach my $line (<$handle>) { |
53
|
30
|
|
|
|
|
55
|
my ($mountpoint, undef, $type) = split(/:/, $line); |
54
|
30
|
|
|
|
|
46
|
$types->{$mountpoint} = $type; |
55
|
|
|
|
|
|
|
} |
56
|
3
|
|
|
|
|
16
|
close $handle; |
57
|
|
|
|
|
|
|
|
58
|
3
|
|
|
|
|
10
|
return $types; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |