+ handle illegal division by 0 (#1492)

This commit is contained in:
Mareau Bastien 2019-05-06 11:43:23 +02:00 committed by Simon Bomm
parent 16d1281382
commit 25e9981d62
1 changed files with 5 additions and 0 deletions

View File

@ -154,6 +154,11 @@ sub manage_selection {
foreach (keys %{$self->{pool}}) {
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $_);
if ($result->{eqlStoragePoolStatsSpace} == 0) {
$self->{output}->output_add(long_msg => "skipping pool '" . $_ . "'. Total size is 0", debug => 1);
next;
}
$self->{pool}->{$_}->{total} = $result->{eqlStoragePoolStatsSpace} * 1024 * 1024;
$self->{pool}->{$_}->{used} = $result->{eqlStoragePoolStatsSpaceUsed} * 1024 * 1024;
}