format sizes
This commit is contained in:
parent
1f71614819
commit
56cbd3ac1b
|
@ -7,7 +7,7 @@ my $sigar = new Sigar;
|
||||||
|
|
||||||
my $fslist = $sigar->file_system_list;
|
my $fslist = $sigar->file_system_list;
|
||||||
|
|
||||||
print "Filesytem\tSize\tUsed\tAvail\tUse%\tMounted on\tType\n";
|
print "Filesystem\tSize\tUsed\tAvail\tUse%\tMounted on\tType\n";
|
||||||
|
|
||||||
for my $fs (@$fslist) {
|
for my $fs (@$fslist) {
|
||||||
my $dirname = $fs->dir_name;
|
my $dirname = $fs->dir_name;
|
||||||
|
@ -34,11 +34,16 @@ for my $fs (@$fslist) {
|
||||||
|
|
||||||
print
|
print
|
||||||
$fs->dev_name . "\t" .
|
$fs->dev_name . "\t" .
|
||||||
$total . "\t" .
|
format_size($total) . "\t" .
|
||||||
$used . "\t" .
|
format_size($used) . "\t" .
|
||||||
$avail . "\t" .
|
format_size($avail) . "\t" .
|
||||||
$usePct . "\t" .
|
$usePct . "\t" .
|
||||||
$dirname . "\t" .
|
$dirname . "\t" .
|
||||||
$fs->sys_type_name . "/" . $fs->type_name . "\n";
|
$fs->sys_type_name . "/" . $fs->type_name . "\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub format_size {
|
||||||
|
my($size) = @_;
|
||||||
|
return Sigar::format_size($size * 1024);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue