mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
F #1324: Configure update interval of VM monitor data
This commit is contained in:
parent
f714459c2a
commit
047c32025c
@ -417,6 +417,7 @@ void OpenNebulaTemplate::set_conf_default()
|
||||
# MONITORING_INTERVAL_VM
|
||||
# MONITORING_INTERVAL_MARKET
|
||||
# MONITORING_INTERVAL_DATASTORE
|
||||
# MONITORING_INTERVAL_DB_UPDATE
|
||||
# MONITORING_THREADS
|
||||
# HOST_PER_INTERVAL
|
||||
# HOST_MONITORING_EXPIRATION_TIME
|
||||
@ -437,6 +438,7 @@ void OpenNebulaTemplate::set_conf_default()
|
||||
set_conf_single("MONITORING_INTERVAL_VM", "180");
|
||||
set_conf_single("MONITORING_INTERVAL_MARKET", "600");
|
||||
set_conf_single("MONITORING_INTERVAL_DATASTORE", "300");
|
||||
set_conf_single("MONITORING_INTERVAL_DB_UPDATE", "0");
|
||||
set_conf_single("MONITORING_THREADS", "50");
|
||||
set_conf_single("HOST_PER_INTERVAL", "15");
|
||||
set_conf_single("HOST_MONITORING_EXPIRATION_TIME", "43200");
|
||||
|
@ -711,6 +711,7 @@ void VirtualMachineManagerDriver::process_poll(VirtualMachine* vm,
|
||||
const string& monitor_str)
|
||||
{
|
||||
char state;
|
||||
time_t update_time;
|
||||
|
||||
Nebula &ne = Nebula::instance();
|
||||
|
||||
@ -720,8 +721,10 @@ void VirtualMachineManagerDriver::process_poll(VirtualMachine* vm,
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Update VM info only for VMs in ACTIVE */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
ne.get_configuration_attribute("MONITORING_INTERVAL_DB_UPDATE", update_time);
|
||||
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE)
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE && update_time != -1 &&
|
||||
(time(0) - vm->get_last_poll() > update_time))
|
||||
{
|
||||
if (vm->update_info(monitor_str) == 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user