mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-06 13:24:28 +02:00
parent
0af6393033
commit
2b0fd9e34b
@ -135,6 +135,8 @@ void MysqlDbConnection::ReconnectTimerHandler(void)
|
|||||||
msgbuf << "MySQL IDO instance id: " << static_cast<long>(m_InstanceID);
|
msgbuf << "MySQL IDO instance id: " << static_cast<long>(m_InstanceID);
|
||||||
Log(LogInformation, "ido_mysql", msgbuf.str());
|
Log(LogInformation, "ido_mysql", msgbuf.str());
|
||||||
|
|
||||||
|
ClearConfigTables();
|
||||||
|
|
||||||
Query("UPDATE " + GetTablePrefix() + "objects SET is_active = 0");
|
Query("UPDATE " + GetTablePrefix() + "objects SET is_active = 0");
|
||||||
|
|
||||||
std::ostringstream q1buf;
|
std::ostringstream q1buf;
|
||||||
@ -158,6 +160,38 @@ void MysqlDbConnection::ReconnectTimerHandler(void)
|
|||||||
UpdateAllObjects();
|
UpdateAllObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MysqlDbConnection::ClearConfigTables(void)
|
||||||
|
{
|
||||||
|
/* TODO make hardcoded table names modular */
|
||||||
|
ClearConfigTable("commands");
|
||||||
|
ClearConfigTable("contact_addresses");
|
||||||
|
ClearConfigTable("contact_notificationcommands");
|
||||||
|
ClearConfigTable("contactgroup_members");
|
||||||
|
ClearConfigTable("contactgroups");
|
||||||
|
ClearConfigTable("contacts");
|
||||||
|
ClearConfigTable("customvariables");
|
||||||
|
ClearConfigTable("host_contactgroups");
|
||||||
|
ClearConfigTable("host_contacts");
|
||||||
|
ClearConfigTable("host_parenthosts");
|
||||||
|
ClearConfigTable("hostdependencies");
|
||||||
|
ClearConfigTable("hostgroup_members");
|
||||||
|
ClearConfigTable("hostgroups");
|
||||||
|
ClearConfigTable("hosts");
|
||||||
|
ClearConfigTable("service_contactgroups");
|
||||||
|
ClearConfigTable("service_contacts");
|
||||||
|
ClearConfigTable("servicedependencies");
|
||||||
|
ClearConfigTable("servicegroup_members");
|
||||||
|
ClearConfigTable("servicegroups");
|
||||||
|
ClearConfigTable("services");
|
||||||
|
ClearConfigTable("timeperiod_timeranges");
|
||||||
|
ClearConfigTable("timeperiods");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MysqlDbConnection::ClearConfigTable(const String& table)
|
||||||
|
{
|
||||||
|
Query("DELETE FROM " + GetTablePrefix() + table + " WHERE instance_id = " + Convert::ToString(static_cast<long>(m_InstanceID)));
|
||||||
|
}
|
||||||
|
|
||||||
Array::Ptr MysqlDbConnection::Query(const String& query)
|
Array::Ptr MysqlDbConnection::Query(const String& query)
|
||||||
{
|
{
|
||||||
Log(LogDebug, "ido_mysql", "Query: " + query);
|
Log(LogDebug, "ido_mysql", "Query: " + query);
|
||||||
|
@ -78,6 +78,9 @@ private:
|
|||||||
|
|
||||||
void TxTimerHandler(void);
|
void TxTimerHandler(void);
|
||||||
void ReconnectTimerHandler(void);
|
void ReconnectTimerHandler(void);
|
||||||
|
|
||||||
|
void ClearConfigTables(void);
|
||||||
|
void ClearConfigTable(const String& table);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user