mirror of https://github.com/Icinga/icinga2.git
Event handlers should be run when services are in a soft state.
Fixes #5681
This commit is contained in:
parent
d3cdbb5156
commit
9bdf2f4766
|
@ -307,7 +307,6 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
|
||||||
|
|
||||||
SetState(cr->GetState());
|
SetState(cr->GetState());
|
||||||
|
|
||||||
bool call_eventhandler = false;
|
|
||||||
bool stateChange = (old_state != GetState());
|
bool stateChange = (old_state != GetState());
|
||||||
if (stateChange) {
|
if (stateChange) {
|
||||||
SetLastStateChange(now);
|
SetLastStateChange(now);
|
||||||
|
@ -333,8 +332,6 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
|
||||||
service->SetNextCheck(Utility::GetTime());
|
service->SetNextCheck(Utility::GetTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
call_eventhandler = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool remove_acknowledgement_comments = false;
|
bool remove_acknowledgement_comments = false;
|
||||||
|
@ -412,7 +409,7 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
|
||||||
else if (stateChange)
|
else if (stateChange)
|
||||||
OnStateChange(GetSelf(), cr, StateTypeSoft, authority);
|
OnStateChange(GetSelf(), cr, StateTypeSoft, authority);
|
||||||
|
|
||||||
if (call_eventhandler)
|
if (GetStateType() == StateTypeSoft || hardChange || recovery)
|
||||||
ExecuteEventHandler();
|
ExecuteEventHandler();
|
||||||
|
|
||||||
if (send_downtime_notification)
|
if (send_downtime_notification)
|
||||||
|
|
Loading…
Reference in New Issue