mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-03 13:47:01 +03:00
* F #2968: Monitor cluster health Signed-off-by: Sergio Vega <svega@opennebula.systems> * F #2968: Set cluster to error if vcenter health is red Signed-off-by: Sergio Vega <svega@opennebula.systems>
This commit is contained in:
parent
5fb69330f3
commit
c1ce6bb5f9
@ -49,7 +49,10 @@ begin
|
||||
cluster = VCenterDriver::ClusterComputeResource.new_from_ref(ccr_ref, vi_client)
|
||||
|
||||
# Print monitoring info
|
||||
puts cluster.monitor
|
||||
cluster_info = cluster.monitor
|
||||
puts cluster_info
|
||||
raise "vCenter cluster health is on red, check issues on vCenter" if cluster_info.include?("STATUS=red")
|
||||
|
||||
puts cluster.monitor_host_systems
|
||||
|
||||
# Print VM monitor info
|
||||
|
@ -101,13 +101,15 @@ class ClusterComputeResource
|
||||
total_memory,
|
||||
effective_mem,
|
||||
num_hosts,
|
||||
num_eff_hosts = @item.collect("summary.totalCpu",
|
||||
num_eff_hosts,
|
||||
overall_status = @item.collect("summary.totalCpu",
|
||||
"summary.numCpuCores",
|
||||
"summary.effectiveCpu",
|
||||
"summary.totalMemory",
|
||||
"summary.effectiveMemory",
|
||||
"summary.numHosts",
|
||||
"summary.numEffectiveHosts"
|
||||
"summary.numEffectiveHosts",
|
||||
"summary.overallStatus"
|
||||
)
|
||||
|
||||
mhz_core = total_cpu.to_f / num_cpu_cores.to_f
|
||||
@ -129,6 +131,7 @@ class ClusterComputeResource
|
||||
str_info << "HYPERVISOR=vcenter\n"
|
||||
str_info << "TOTALHOST=" << num_hosts.to_s << "\n"
|
||||
str_info << "AVAILHOST=" << num_eff_hosts.to_s << "\n"
|
||||
str_info << "STATUS=" << overall_status << "\n"
|
||||
|
||||
# CPU
|
||||
str_info << "CPUSPEED=" << mhz_core.to_s << "\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user