add S.M.A.R.T. data collector
[metriccd.git] / client / meter / df
blobc64f9729b2900356d16a3b31aaf4c09b6698c974
1 #!/usr/bin/env perl
3 require "common.pl";
5 @exclude_fstypes = (qw/devtmpfs fuse.encfs/);
7 open $fh, '-|', qw/df --local --block-size=1 --output=itotal,iused,size,used,fstype,target/ or die "$0: $!\n";
8 <$fh>; # consume header
9 while(<$fh>)
11 chomp;
12 s/^\s*//;
13 my($itotal, $iused, $size, $used, $fstype, $target) = split /\s+/, $_, 6;
14 if(grep {$fstype eq $_} @exclude_fstypes) { next; }
16 $DF{$target}->{'inodes'}->{'total'} = $itotal;
17 $DF{$target}->{'inodes'}->{'used'} = $iused;
18 $DF{$target}->{'bytes'}->{'total'} = $size;
19 $DF{$target}->{'bytes'}->{'used'} = $used;
22 svlhk_dump(\%DF);