mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
(plugin) storage::dell::powerstore::restapi - fix memory mode (#4480)
This commit is contained in:
parent
dd314fa1eb
commit
cde60ceeb1
@ -101,13 +101,15 @@ sub manage_selection {
|
|||||||
next if (defined($self->{option_results}->{filter_appliance_id}) && $self->{option_results}->{filter_appliance_id} ne '' &&
|
next if (defined($self->{option_results}->{filter_appliance_id}) && $self->{option_results}->{filter_appliance_id} ne '' &&
|
||||||
$appliance_id !~ /$self->{option_results}->{filter_appliance_id}/);
|
$appliance_id !~ /$self->{option_results}->{filter_appliance_id}/);
|
||||||
|
|
||||||
my $free = $appliances->{$appliance_id}->{last_physical_total} - $appliances->{$appliance_id}->{last_physical_used};
|
my $total = defined($appliances->{$appliance_id}->[-1]->{last_physical_total}) ? $appliances->{$appliance_id}->[-1]->{last_physical_total} : $appliances->{$appliance_id}->[-1]->{physical_total};
|
||||||
|
my $used = defined($appliances->{$appliance_id}->[-1]->{last_physical_used}) ? $appliances->{$appliance_id}->[-1]->{last_physical_used} : $appliances->{$appliance_id}->[-1]->{physical_used};
|
||||||
|
my $free = $total - $used;
|
||||||
$self->{memory}->{ $appliance_id } = {
|
$self->{memory}->{ $appliance_id } = {
|
||||||
total => $appliances->{$appliance_id}->{last_physical_total},
|
total => $total,
|
||||||
used => $appliances->{$appliance_id}->{last_physical_used},
|
used => $used,
|
||||||
free => $free,
|
free => $free,
|
||||||
prct_used => $appliances->{$appliance_id}->{last_physical_used} * 100 / $appliances->{$appliance_id}->{last_physical_total},
|
prct_used => $used * 100 / $total,
|
||||||
prct_free => $free * 100 / $appliances->{$appliance_id}->{last_physical_total}
|
prct_free => $free * 100 / $total
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user