This commit is contained in:
garnier-quentin 2016-10-27 17:42:28 +02:00
parent 8984138600
commit ded0bb7eae
1 changed files with 12 additions and 0 deletions

View File

@ -162,6 +162,18 @@ sub run {
foreach (sort @{$self->{storage_id_selected}}) { foreach (sort @{$self->{storage_id_selected}}) {
my $name_storage = $self->get_display_value(id => $_); my $name_storage = $self->get_display_value(id => $_);
if (!defined($result->{$oid_hrStorageAllocationUnits . "." . $_})) {
if ($multiple == 0) {
$self->{output}->add_option_msg(severity => 'UNKNOWN',
short_msg => sprintf("Skipping storage '%s': not found (need to reload the cache)",
$name_storage));
} else {
$self->{output}->add_option_msg(long_msg => sprintf("Skipping storage '%s': not found (need to reload the cache)",
$name_storage));
}
next;
}
# in bytes hrStorageAllocationUnits # in bytes hrStorageAllocationUnits
my $total_size = $result->{$oid_hrStorageSize . "." . $_} * $result->{$oid_hrStorageAllocationUnits . "." . $_}; my $total_size = $result->{$oid_hrStorageSize . "." . $_} * $result->{$oid_hrStorageAllocationUnits . "." . $_};
if ($total_size <= 0) { if ($total_size <= 0) {