diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index e31988837..abd8610b0 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -102,6 +102,7 @@ void IcingaDB::ConfigStaticInitialize() Checkable::OnNewCheckResult.connect([](const Checkable::Ptr& checkable, const CheckResult::Ptr&, const MessageOrigin::Ptr&) { IcingaDB::NewCheckResultHandler(checkable); }); + Checkable::OnNextCheckChanged.connect([](const Checkable::Ptr& checkable, const Value&) { IcingaDB::NextCheckChangedHandler(checkable); }); @@ -2044,6 +2045,7 @@ void IcingaDB::FlappingChangeHandler(const Checkable::Ptr& checkable, double cha void IcingaDB::NewCheckResultHandler(const Checkable::Ptr& checkable) { for (auto& rw : ConfigType::GetObjectsByType()) { + rw->UpdateState(checkable); rw->SendNextUpdate(checkable); } } diff --git a/lib/icingadb/icingadb.cpp b/lib/icingadb/icingadb.cpp index 96ddcb3fb..069eda601 100644 --- a/lib/icingadb/icingadb.cpp +++ b/lib/icingadb/icingadb.cpp @@ -193,19 +193,6 @@ void IcingaDB::SendEvent(const Dictionary::Ptr& event) String type = event->Get("type"); - if (type == "CheckResult") { - Checkable::Ptr checkable; - - if (event->Contains("service")) { - checkable = Service::GetByNamePair(event->Get("host"), event->Get("service")); - } else { - checkable = Host::GetByName(event->Get("host")); - } - - // Update State for icingaweb - m_WorkQueue.Enqueue([this, checkable]() { UpdateState(checkable); }); - } - if (type.Contains("Acknowledgement")) { Checkable::Ptr checkable;