From 382489c288bd8d31af9983b355335ceb9dd6fa33 Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Fri, 23 Nov 2018 15:49:25 +0100 Subject: [PATCH] enh hp storeonce cluster usage (#1237) --- storage/hp/storeonce/restapi/mode/clusterusage.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/storage/hp/storeonce/restapi/mode/clusterusage.pm b/storage/hp/storeonce/restapi/mode/clusterusage.pm index 37f6fde08..e8cf75de0 100644 --- a/storage/hp/storeonce/restapi/mode/clusterusage.pm +++ b/storage/hp/storeonce/restapi/mode/clusterusage.pm @@ -229,12 +229,15 @@ sub manage_selection { $self->{output}->output_add(long_msg => "skipping '" . $entry->{properties}->{applianceName} . "': no matching filter.", debug => 1); next; } + + my $total = (defined($entry->{properties}->{capacity})) ? $entry->{properties}->{capacity} * 1024 * 1024 * 1024 : $entry->{properties}->{localCapacityBytes}; + my $used = $total - (defined($entry->{properties}->{freeSpace})) ? $entry->{properties}->{freeSpace} * 1024 * 1024 * 1024 : $entry->{properties}->{localFreeBytes}; $self->{cluster}->{$entry->{properties}->{serialNumber}} = { display => $entry->{properties}->{applianceName}, health => $mapping_health_level{$entry->{properties}->{healthLevel}}, - total => $entry->{properties}->{capacity} * 1024 * 1024 * 1024, # GB - used => ($entry->{properties}->{capacity} - $entry->{properties}->{freeSpace}) * 1024 * 1024 * 1024, # GB + total => $total, + used => $used, dedup => $entry->{properties}->{dedupeRatio} }; } }