mirror of https://github.com/Icinga/icinga2.git
Drop IcingaDB#SendEvent()
This commit is contained in:
parent
867481de7c
commit
54d555bd92
|
@ -176,36 +176,12 @@ void IcingaDB::HandleEvents()
|
|||
|
||||
if (!event)
|
||||
continue;
|
||||
|
||||
m_WorkQueue.Enqueue([this, event]() { SendEvent(event); });
|
||||
}
|
||||
|
||||
queue->RemoveClient(this);
|
||||
EventQueue::UnregisterIfUnused(queueName, queue);
|
||||
}
|
||||
|
||||
void IcingaDB::SendEvent(const Dictionary::Ptr& event)
|
||||
{
|
||||
AssertOnWorkQueue();
|
||||
|
||||
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||
return;
|
||||
|
||||
String type = event->Get("type");
|
||||
|
||||
if (type.Contains("Acknowledgement")) {
|
||||
Checkable::Ptr checkable;
|
||||
|
||||
if (event->Contains("service")) {
|
||||
checkable = Service::GetByNamePair(event->Get("host"), event->Get("service"));
|
||||
event->Set("service_id", GetObjectIdentifier(checkable));
|
||||
} else {
|
||||
checkable = Host::GetByName(event->Get("host"));
|
||||
event->Set("host_id", GetObjectIdentifier(checkable));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IcingaDB::Stop(bool runtimeRemoved)
|
||||
{
|
||||
Log(LogInformation, "IcingaDB")
|
||||
|
|
|
@ -38,7 +38,6 @@ private:
|
|||
void ReconnectTimerHandler();
|
||||
void TryToReconnect();
|
||||
void HandleEvents();
|
||||
void SendEvent(const Dictionary::Ptr& event);
|
||||
|
||||
void PublishStatsTimerHandler();
|
||||
void PublishStats();
|
||||
|
|
Loading…
Reference in New Issue