1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-28 14:50:08 +03:00

Feature #3718: Update xpaths for the new probes in onevm and oneacct

This commit is contained in:
Jaime Melis 2015-06-26 11:23:56 +02:00
parent 957a48d10f
commit 316fa03e75
2 changed files with 12 additions and 17 deletions

View File

@ -155,26 +155,22 @@ class AcctHelper < OpenNebulaHelper::OneHelper
d["VM"]["TEMPLATE"]["CPU"]
end
column :NET_RX, "Data received from the network", :size=>6 do |d|
column :NETRX, "Data received from the network", :size=>6 do |d|
# NET is measured in bytes, unit_to_str expects KBytes
OpenNebulaHelper.unit_to_str(d["VM"]["MONITORING/NETRX"].to_i / 1024.0, {})
end
column :NET_TX, "Data sent to the network", :size=>6 do |d|
column :NETTX, "Data sent to the network", :size=>6 do |d|
# NET is measured in bytes, unit_to_str expects KBytes
OpenNebulaHelper.unit_to_str(d["VM"]["MONITORING/NETTX"].to_i / 1024.0, {})
end
column :DISK_ACTUAL, "Total disk size used", :size=>6 do |d|
column :TOTAL_DISK_SIZE, "Total disk size used", :size=>6 do |d|
# DISK size is measured in mb, unit_to_str expects KBytes
OpenNebulaHelper.unit_to_str(d["VM"]["MONITORING/DISK_ACTUAL_SIZE"].to_i * 1024.0, {})
OpenNebulaHelper.unit_to_str(d["VM"]["MONITORING/TOTAL_DISK_SIZE"].to_i * 1024.0, {})
end
column :DISK_VIRTUAL, "Total disk virtual size used", :size=>6 do |d|
# DISK size is measured in mb, unit_to_str expects KBytes
OpenNebulaHelper.unit_to_str(d["VM"]["MONITORING/DISK_VIRTUAL_SIZE"].to_i * 1024.0, {})
end
default :VID, :HOSTNAME, :ACTION, :REASON, :START_TIME, :END_TIME, :MEMORY, :CPU, :NET_RX, :NET_TX, :DISK_ACTUAL, :DISK_VIRTUAL
default :VID, :HOSTNAME, :ACTION, :REASON, :START_TIME, :END_TIME, :MEMORY, :CPU, :NETRX, :NETTX, :TOTAL_DISK_SIZE
end
SHOWBACK_TABLE = CLIHelper::ShowTable.new("oneshowback.yaml", nil) do

View File

@ -503,18 +503,17 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
CLIHelper.print_header(str_h1 % "VIRTUAL MACHINE MONITORING",false)
poll_attrs = {
"USED MEMORY" => "MONITORING/USEDMEMORY",
"USED CPU" => "MONITORING/USEDCPU",
"NET_TX" => "MONITORING/NETTX",
"NET_RX" => "MONITORING/NETRX",
"DISK SIZE (ACTUAL)" => "MONITORING/DISK_ACTUAL_SIZE",
"DISK SIZE (VIRTUAL)" => "MONITORING/DISK_VIRTUAL_SIZE"
"MEMORY" => "MONITORING/MEMORY",
"CPU" => "MONITORING/CPU",
"NETTX" => "MONITORING/NETTX",
"NETRX" => "MONITORING/NETRX",
"TOTAL DISK SIZE" => "MONITORING/TOTAL_DISK_SIZE"
}
poll_attrs.each { |k,v|
if k == "USED CPU"
if k == "CPU"
puts str % [k,vm[v]]
elsif k == "USED MEMORY"
elsif k == "MEMORY"
puts str % [k, OpenNebulaHelper.unit_to_str(vm[v].to_i, {})]
elsif k =~ /DISK/
puts str % [k, OpenNebulaHelper.unit_to_str(vm[v].to_i*1024, {})]