fix fortinet core filter cpu

This commit is contained in:
garnier-quentin 2020-03-31 11:34:20 +02:00
parent 2d26fccebd
commit e9c92daeed
1 changed files with 2 additions and 1 deletions

View File

@ -147,8 +147,9 @@ sub manage_selection {
$cpu += $snmp_result->{$oid_fgProcessorUsage}->{$_};
}
my $num_core = scalar(keys %{$self->{cpu_core}});
$self->{cpu_avg} = {
average => ($i > 0) ? $cpu / $i : $snmp_result->{$oid_fgSysCpuUsage}->{$oid_fgSysCpuUsage . '.0'}
average => $num_core > 0 ? $cpu / $num_core : $snmp_result->{$oid_fgSysCpuUsage}->{$oid_fgSysCpuUsage . '.0'}
};
if (defined($self->{option_results}->{cluster})) {