mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 06:34:42 +02:00
parent
7a79886922
commit
45161fe66d
@ -233,6 +233,7 @@ void IdoMysqlConnection::ClearConfigTables(void)
|
|||||||
{
|
{
|
||||||
/* TODO make hardcoded table names modular */
|
/* TODO make hardcoded table names modular */
|
||||||
ClearConfigTable("commands");
|
ClearConfigTable("commands");
|
||||||
|
ClearConfigTable("comments");
|
||||||
ClearConfigTable("contact_addresses");
|
ClearConfigTable("contact_addresses");
|
||||||
ClearConfigTable("contact_notificationcommands");
|
ClearConfigTable("contact_notificationcommands");
|
||||||
ClearConfigTable("contactgroup_members");
|
ClearConfigTable("contactgroup_members");
|
||||||
@ -246,6 +247,7 @@ void IdoMysqlConnection::ClearConfigTables(void)
|
|||||||
ClearConfigTable("hostgroup_members");
|
ClearConfigTable("hostgroup_members");
|
||||||
ClearConfigTable("hostgroups");
|
ClearConfigTable("hostgroups");
|
||||||
ClearConfigTable("hosts");
|
ClearConfigTable("hosts");
|
||||||
|
ClearConfigTable("scheduleddowntime");
|
||||||
ClearConfigTable("service_contactgroups");
|
ClearConfigTable("service_contactgroups");
|
||||||
ClearConfigTable("service_contacts");
|
ClearConfigTable("service_contacts");
|
||||||
ClearConfigTable("servicedependencies");
|
ClearConfigTable("servicedependencies");
|
||||||
|
@ -237,6 +237,7 @@ void IdoPgsqlConnection::ClearConfigTables(void)
|
|||||||
{
|
{
|
||||||
/* TODO make hardcoded table names modular */
|
/* TODO make hardcoded table names modular */
|
||||||
ClearConfigTable("commands");
|
ClearConfigTable("commands");
|
||||||
|
ClearConfigTable("comments");
|
||||||
ClearConfigTable("contact_addresses");
|
ClearConfigTable("contact_addresses");
|
||||||
ClearConfigTable("contact_notificationcommands");
|
ClearConfigTable("contact_notificationcommands");
|
||||||
ClearConfigTable("contactgroup_members");
|
ClearConfigTable("contactgroup_members");
|
||||||
@ -250,6 +251,7 @@ void IdoPgsqlConnection::ClearConfigTables(void)
|
|||||||
ClearConfigTable("hostgroup_members");
|
ClearConfigTable("hostgroup_members");
|
||||||
ClearConfigTable("hostgroups");
|
ClearConfigTable("hostgroups");
|
||||||
ClearConfigTable("hosts");
|
ClearConfigTable("hosts");
|
||||||
|
ClearConfigTable("scheduleddowntime");
|
||||||
ClearConfigTable("service_contactgroups");
|
ClearConfigTable("service_contactgroups");
|
||||||
ClearConfigTable("service_contacts");
|
ClearConfigTable("service_contacts");
|
||||||
ClearConfigTable("servicedependencies");
|
ClearConfigTable("servicedependencies");
|
||||||
|
@ -211,14 +211,6 @@ void ServiceDbObject::OnConfigUpdate(void)
|
|||||||
/* service dependencies */
|
/* service dependencies */
|
||||||
Log(LogDebug, "db_ido", "service dependencies for '" + service->GetName() + "'");
|
Log(LogDebug, "db_ido", "service dependencies for '" + service->GetName() + "'");
|
||||||
|
|
||||||
DbQuery query_del1;
|
|
||||||
query_del1.Table = GetType()->GetTable() + "dependencies";
|
|
||||||
query_del1.Type = DbQueryDelete;
|
|
||||||
query_del1.Category = DbCatConfig;
|
|
||||||
query_del1.WhereCriteria = make_shared<Dictionary>();
|
|
||||||
query_del1.WhereCriteria->Set("dependent_service_object_id", service);
|
|
||||||
OnQuery(query_del1);
|
|
||||||
|
|
||||||
BOOST_FOREACH(const Service::Ptr& parent, service->GetParentServices()) {
|
BOOST_FOREACH(const Service::Ptr& parent, service->GetParentServices()) {
|
||||||
Log(LogDebug, "db_ido", "service parents: " + parent->GetName());
|
Log(LogDebug, "db_ido", "service parents: " + parent->GetName());
|
||||||
|
|
||||||
@ -276,14 +268,6 @@ void ServiceDbObject::OnConfigUpdate(void)
|
|||||||
/* custom variables */
|
/* custom variables */
|
||||||
Log(LogDebug, "db_ido", "service customvars for '" + service->GetName() + "'");
|
Log(LogDebug, "db_ido", "service customvars for '" + service->GetName() + "'");
|
||||||
|
|
||||||
DbQuery query_del2;
|
|
||||||
query_del2.Table = "customvariables";
|
|
||||||
query_del2.Type = DbQueryDelete;
|
|
||||||
query_del2.Category = DbCatConfig;
|
|
||||||
query_del2.WhereCriteria = make_shared<Dictionary>();
|
|
||||||
query_del2.WhereCriteria->Set("object_id", service);
|
|
||||||
OnQuery(query_del2);
|
|
||||||
|
|
||||||
Dictionary::Ptr customvars;
|
Dictionary::Ptr customvars;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -317,8 +301,6 @@ void ServiceDbObject::OnConfigUpdate(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update comments and downtimes on config change */
|
/* update comments and downtimes on config change */
|
||||||
RemoveComments(service);
|
|
||||||
RemoveDowntimes(service);
|
|
||||||
AddComments(service);
|
AddComments(service);
|
||||||
AddDowntimes(service);
|
AddDowntimes(service);
|
||||||
|
|
||||||
|
@ -48,9 +48,6 @@ void Service::Start(void)
|
|||||||
|
|
||||||
VERIFY(GetHost());
|
VERIFY(GetHost());
|
||||||
|
|
||||||
SetSchedulingOffset(Utility::Random());
|
|
||||||
UpdateNextCheck();
|
|
||||||
|
|
||||||
AddDowntimesToCache();
|
AddDowntimesToCache();
|
||||||
AddCommentsToCache();
|
AddCommentsToCache();
|
||||||
|
|
||||||
@ -78,6 +75,11 @@ void Service::OnConfigLoaded(void)
|
|||||||
m_Host->AddService(GetSelf());
|
m_Host->AddService(GetSelf());
|
||||||
|
|
||||||
UpdateSlaveNotifications();
|
UpdateSlaveNotifications();
|
||||||
|
|
||||||
|
SetSchedulingOffset(Utility::Random());
|
||||||
|
|
||||||
|
if (GetNextCheck() < Utility::GetTime() + 300)
|
||||||
|
SetNextCheck(Utility::GetTime() + Utility::Random() % 300);
|
||||||
}
|
}
|
||||||
|
|
||||||
Service::Ptr Service::GetByNamePair(const String& hostName, const String& serviceName)
|
Service::Ptr Service::GetByNamePair(const String& hostName, const String& serviceName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user