DiskUsage probe tests
[scpubgit/System-Introspector.git] / lib / System / Introspector / DiskUsage.pm
CommitLineData
6580617b 1package System::Introspector::DiskUsage;
2use Moo;
3
4sub gather {
5 my ($self) = @_;
6 my @lines = `df -aP`;
7 shift @lines; # header
8 chomp @lines;
9 my @rows;
10 for my $line (@lines) {
11 my %row;
12 @row{qw(
13 filesystem
14 blocks_1024
15 used
16 available
17 capacity
18 mount_point
19 )} = split m{\s+}, $line;
20 push @rows, \%row;
21 }
22 return \@rows;
23}
24
251;