From 0c85e1eb27a3fd293c815db9d0fa8ffdc9216e9d Mon Sep 17 00:00:00 2001 From: "Carlos J. Herrera" Date: Tue, 13 Oct 2020 12:55:54 -0400 Subject: [PATCH] B #5113: collect correct attributes vCenter host (#303) Signed-off-by: Carlos Herrera (cherry picked from commit c95839dc66312f89519749f30ab5322dbff7f38b) --- src/im_mad/remotes/lib/vcenter_cluster.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/im_mad/remotes/lib/vcenter_cluster.rb b/src/im_mad/remotes/lib/vcenter_cluster.rb index 549eaa094f..2662ce9d5a 100644 --- a/src/im_mad/remotes/lib/vcenter_cluster.rb +++ b/src/im_mad/remotes/lib/vcenter_cluster.rb @@ -307,13 +307,15 @@ class Cluster end def cluster_monitoring - metrics = @cluster.item.collect(*(CLUSTER_PROPERTIES[0..4])) + resource_usage_summary = @cluster.item.GetResourceUsage() - total_cpu = metrics[0].to_f - num_cpu_cores = metrics[1].to_f - effective_cpu = metrics[2].to_f - total_memory = metrics[3].to_i - effective_mem = metrics[4].to_i + metrics = @cluster.item.collect(*(CLUSTER_PROPERTIES[1])) + num_cpu_cores = metrics[0].to_f + + total_cpu = resource_usage_summary.cpuCapacityMHz.to_f + effective_cpu = resource_usage_summary.cpuUsedMHz.to_f + total_memory = resource_usage_summary.memCapacityMB.to_i + effective_mem = resource_usage_summary.memUsedMB.to_i if num_cpu_cores > 0 mhz_core = total_cpu / num_cpu_cores