fix cpu-host variable not defined

This commit is contained in:
garnier-quentin 2020-01-23 15:14:43 +01:00
parent 3fa466c595
commit 3e0ca26bb6
1 changed files with 2 additions and 1 deletions

View File

@ -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,
},
};