From 3e0ca26bb60d7f0b34514015eee07a9e1e288537 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 23 Jan 2020 15:14:43 +0100 Subject: [PATCH] fix cpu-host variable not defined --- apps/vmware/connector/mode/cpuhost.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/vmware/connector/mode/cpuhost.pm b/apps/vmware/connector/mode/cpuhost.pm index b5732376e..9d59e9299 100644 --- a/apps/vmware/connector/mode/cpuhost.pm +++ b/apps/vmware/connector/mode/cpuhost.pm @@ -163,7 +163,8 @@ sub manage_selection { global_cpu => { cpu_average => $response->{data}->{$host_id}->{'cpu.usage.average'}, cpu_average_mhz => $response->{data}->{$host_id}->{'cpu.usagemhz.average'}, - cpu_average_mhz_max => $response->{data}->{$host_id}->{numCpuCores} * $response->{data}->{$host_id}->{cpuMhz}, + cpu_average_mhz_max => defined($response->{data}->{$host_id}->{numCpuCores}) ? + $response->{data}->{$host_id}->{numCpuCores} * $response->{data}->{$host_id}->{cpuMhz} : undef, }, };