mirror of
https://github.com/Icinga/icinga2.git
synced 2025-06-04 22:00:16 +02:00
Drop IcingaDB#SendEvent()
This commit is contained in:
parent
867481de7c
commit
54d555bd92
@ -176,36 +176,12 @@ void IcingaDB::HandleEvents()
|
|||||||
|
|
||||||
if (!event)
|
if (!event)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
m_WorkQueue.Enqueue([this, event]() { SendEvent(event); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
queue->RemoveClient(this);
|
queue->RemoveClient(this);
|
||||||
EventQueue::UnregisterIfUnused(queueName, queue);
|
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)
|
void IcingaDB::Stop(bool runtimeRemoved)
|
||||||
{
|
{
|
||||||
Log(LogInformation, "IcingaDB")
|
Log(LogInformation, "IcingaDB")
|
||||||
|
@ -38,7 +38,6 @@ private:
|
|||||||
void ReconnectTimerHandler();
|
void ReconnectTimerHandler();
|
||||||
void TryToReconnect();
|
void TryToReconnect();
|
||||||
void HandleEvents();
|
void HandleEvents();
|
||||||
void SendEvent(const Dictionary::Ptr& event);
|
|
||||||
|
|
||||||
void PublishStatsTimerHandler();
|
void PublishStatsTimerHandler();
|
||||||
void PublishStats();
|
void PublishStats();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user