added base pod to all probes
[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;
535e84b6 26
27__END__
28
29=head1 NAME
30
31System::Introspector::DiskUsage - Gather disk space usage data
32
33=head1 DESCRIPTION
34
35Uses C<df> to get data about current disk usage.
36
37=head1 SEE ALSO
38
39=over
40
41=item L<System::Introspector>
42
43=back
44
45=cut
46