From e5c1849cb901a73e1cb597acdf2cb90b6ca7150c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 8 Oct 2012 21:12:39 +0000 Subject: [PATCH] mogadm: show weight in "mogadm device list" mogadm provides a way to set the device weight, so there should be a way to view it from the same tool. Conflicts: mogadm --- mogadm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mogadm b/mogadm index 169f9d3..a9956a0 100755 --- a/mogadm +++ b/mogadm @@ -817,7 +817,7 @@ sub cmd_device_list { } print "$host->{hostname} [$hostid]: $host->{status}\n"; - printf "%6s %-10s %7s %7s %7s\n", '', '', 'used(G)', 'free(G)', 'total(G)'; + printf "%6s %-10s %7s %7s %7s %7s\n", '', '', 'used(G)', 'free(G)', 'total(G)', 'weight(%)'; foreach my $devid (sort keys %{$devs->{$hostid} || {}}) { my $dev = $devs->{$hostid}->{$devid}; next if $dev->{status} eq "dead" && ! $args->{all}; @@ -825,7 +825,7 @@ sub cmd_device_list { my $total = $dev->{mb_total} / 1024; my $used = $dev->{mb_used} / 1024; my $free = $total - $used; - printf "%6s: %-10s %-7.3f %-7.3f %-7.3f\n", "dev$devid", $dev->{status}, $used, $free, $total; + printf "%6s: %-10s %-7.3f %-7.3f %-7.3f % 3u\n", "dev$devid", $dev->{status}, $used, $free, $total, $dev->{weight}; } print "\n";