(plugin) network::fiberstore::snmp - harden memory mode check (#3514)

This commit is contained in:
qgarnier 2022-03-01 10:59:20 +01:00 committed by GitHub
parent 1c100eed49
commit f40b77a3a3
1 changed files with 5 additions and 0 deletions

View File

@ -100,6 +100,11 @@ sub manage_selection {
if (!defined($result->{total})) {
($total, $free) = ('total_legacy', 'free_legacy');
}
if ($result->{$total} !~ /[0-9]+/) {
$self->{output}->add_option_msg(short_msg => 'cannot get informations');
$self->{output}->option_exit();
}
$result->{$total} *= 1024;
$result->{$free} *= 1024;