From e9c92daeed6666cfdcc33ca0ae51b43e306e9202 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 31 Mar 2020 11:34:20 +0200 Subject: [PATCH] fix fortinet core filter cpu --- centreon/common/fortinet/fortigate/snmp/mode/cpu.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/centreon/common/fortinet/fortigate/snmp/mode/cpu.pm b/centreon/common/fortinet/fortigate/snmp/mode/cpu.pm index 91185c599..245ce76e6 100644 --- a/centreon/common/fortinet/fortigate/snmp/mode/cpu.pm +++ b/centreon/common/fortinet/fortigate/snmp/mode/cpu.pm @@ -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})) {