mirror of https://github.com/Icinga/icinga2.git
Icinga DB: ensure is_reachable and severity don't miss updates
refs #9143
This commit is contained in:
parent
185fab3761
commit
84d09876b4
|
@ -84,6 +84,10 @@ void IcingaDB::ConfigStaticInitialize()
|
|||
AcknowledgementClearedHandler(checkable, removedBy, changeTime);
|
||||
});
|
||||
|
||||
Checkable::OnReachabilityChanged.connect([](const Checkable::Ptr&, const CheckResult::Ptr&, std::set<Checkable::Ptr> children, const MessageOrigin::Ptr&) {
|
||||
IcingaDB::ReachabilityChangeHandler(children);
|
||||
});
|
||||
|
||||
/* triggered on create, update and delete objects */
|
||||
ConfigObject::OnActiveChanged.connect([](const ConfigObject::Ptr& object, const Value&) {
|
||||
IcingaDB::VersionChangedHandler(object);
|
||||
|
@ -2599,6 +2603,15 @@ void IcingaDB::StateChangeHandler(const ConfigObject::Ptr& object, const CheckRe
|
|||
}
|
||||
}
|
||||
|
||||
void IcingaDB::ReachabilityChangeHandler(const std::set<Checkable::Ptr>& children)
|
||||
{
|
||||
for (const IcingaDB::Ptr& rw : ConfigType::GetObjectsByType<IcingaDB>()) {
|
||||
for (auto& checkable : children) {
|
||||
rw->UpdateState(checkable, StateUpdate::Full);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IcingaDB::VersionChangedHandler(const ConfigObject::Ptr& object)
|
||||
{
|
||||
Type::Ptr type = object->GetReflectionType();
|
||||
|
|
|
@ -136,6 +136,7 @@ private:
|
|||
static String GetLowerCaseTypeNameDB(const ConfigObject::Ptr& obj);
|
||||
static bool PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& attributes, Dictionary::Ptr& checkSums);
|
||||
|
||||
static void ReachabilityChangeHandler(const std::set<Checkable::Ptr>& children);
|
||||
static void StateChangeHandler(const ConfigObject::Ptr& object, const CheckResult::Ptr& cr, StateType type);
|
||||
static void VersionChangedHandler(const ConfigObject::Ptr& object);
|
||||
static void DowntimeStartedHandler(const Downtime::Ptr& downtime);
|
||||
|
|
Loading…
Reference in New Issue