B #5113: collect correct attributes vCenter host (#303)

Signed-off-by: Carlos Herrera <cherrera@opennebula.io>
(cherry picked from commit c95839dc66)
This commit is contained in:
Carlos J. Herrera authored and Tino Vazquez committed 2020-10-13 18:56:15 +02:00
1 parent 542fd01126
commit 0c85e1eb27
1 file changed
+8 -6
+8 -6
View File
@@ -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