"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/icinga/checkable-check.cpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

checkable-check.cpp  (icinga2-2.11.5):checkable-check.cpp  (icinga2-2.12.0)
skipping to change at line 270 skipping to change at line 270
/* Store the current last state change for the next iteration. */ /* Store the current last state change for the next iteration. */
SetPreviousStateChange(GetLastStateChange()); SetPreviousStateChange(GetLastStateChange());
if (stateChange) { if (stateChange) {
SetLastStateChange(now); SetLastStateChange(now);
/* remove acknowledgements */ /* remove acknowledgements */
if (GetAcknowledgement() == AcknowledgementNormal || if (GetAcknowledgement() == AcknowledgementNormal ||
(GetAcknowledgement() == AcknowledgementSticky && IsState OK(new_state))) { (GetAcknowledgement() == AcknowledgementSticky && IsState OK(new_state))) {
ClearAcknowledgement(); ClearAcknowledgement("");
} }
/* reschedule direct parents */ /* reschedule direct parents */
for (const Checkable::Ptr& parent : GetParents()) { for (const Checkable::Ptr& parent : GetParents()) {
if (parent.get() == this) if (parent.get() == this)
continue; continue;
if (!parent->GetEnableActiveChecks()) if (!parent->GetEnableActiveChecks())
continue; continue;
skipping to change at line 303 skipping to change at line 303
bool hardChange = (GetStateType() == StateTypeHard && old_stateType == St ateTypeSoft); bool hardChange = (GetStateType() == StateTypeHard && old_stateType == St ateTypeSoft);
if (stateChange && old_stateType == StateTypeHard && GetStateType() == St ateTypeHard) if (stateChange && old_stateType == StateTypeHard && GetStateType() == St ateTypeHard)
hardChange = true; hardChange = true;
bool is_volatile = GetVolatile(); bool is_volatile = GetVolatile();
if (hardChange || is_volatile) { if (hardChange || is_volatile) {
SetLastHardStateRaw(new_state); SetLastHardStateRaw(new_state);
SetLastHardStateChange(now); SetLastHardStateChange(now);
SetLastHardStatesRaw(GetLastHardStatesRaw() / 100u + new_state *
100u);
}
if (stateChange) {
SetLastSoftStatesRaw(GetLastSoftStatesRaw() / 100u + new_state *
100u);
} }
if (!IsStateOK(new_state)) if (!IsStateOK(new_state))
TriggerDowntimes(); TriggerDowntimes();
/* statistics for external tools */ /* statistics for external tools */
Checkable::UpdateStatistics(cr, checkableType); Checkable::UpdateStatistics(cr, checkableType);
bool in_downtime = IsInDowntime(); bool in_downtime = IsInDowntime();
skipping to change at line 347 skipping to change at line 352
{ "attempt", GetCheckAttempt() }, { "attempt", GetCheckAttempt() },
{ "reachable", reachable } { "reachable", reachable }
}); });
if (old_cr) if (old_cr)
cr->SetVarsBefore(old_cr->GetVarsAfter()); cr->SetVarsBefore(old_cr->GetVarsAfter());
cr->SetVarsAfter(vars_after); cr->SetVarsAfter(vars_after);
olock.Lock(); olock.Lock();
SetLastCheckResult(cr);
if (service) {
SetLastCheckResult(cr);
} else {
bool wasProblem = GetProblem();
SetLastCheckResult(cr);
if (GetProblem() != wasProblem) {
for (auto& service : host->GetServices()) {
Service::OnHostProblemChanged(service, cr, origin
);
}
}
}
bool was_flapping = IsFlapping(); bool was_flapping = IsFlapping();
UpdateFlappingStatus(old_state != cr->GetState()); UpdateFlappingStatus(old_state != cr->GetState());
bool is_flapping = IsFlapping(); bool is_flapping = IsFlapping();
if (cr->GetActive()) { if (cr->GetActive()) {
UpdateNextCheck(origin); UpdateNextCheck(origin);
} else { } else {
skipping to change at line 499 skipping to change at line 517
} }
void Checkable::ExecuteCheck() void Checkable::ExecuteCheck()
{ {
CONTEXT("Executing check for object '" + GetName() + "'"); CONTEXT("Executing check for object '" + GetName() + "'");
/* keep track of scheduling info in case the check type doesn't provide i ts own information */ /* keep track of scheduling info in case the check type doesn't provide i ts own information */
double scheduled_start = GetNextCheck(); double scheduled_start = GetNextCheck();
double before_check = Utility::GetTime(); double before_check = Utility::GetTime();
SetLastCheckStarted(Utility::GetTime());
/* This calls SetNextCheck() which updates the CheckerComponent's idle/pe nding /* This calls SetNextCheck() which updates the CheckerComponent's idle/pe nding
* queues and ensures that checks are not fired multiple times. ProcessCh eckResult() * queues and ensures that checks are not fired multiple times. ProcessCh eckResult()
* is called too late. See #6421. * is called too late. See #6421.
*/ */
UpdateNextCheck(); UpdateNextCheck();
bool reachable = IsReachable(); bool reachable = IsReachable();
{ {
ObjectLock olock(this); ObjectLock olock(this);
skipping to change at line 554 skipping to change at line 574
Dictionary::Ptr params = new Dictionary(); Dictionary::Ptr params = new Dictionary();
message->Set("params", params); message->Set("params", params);
params->Set("command_type", "check_command"); params->Set("command_type", "check_command");
params->Set("command", GetCheckCommand()->GetName()); params->Set("command", GetCheckCommand()->GetName());
params->Set("host", host->GetName()); params->Set("host", host->GetName());
if (service) if (service)
params->Set("service", service->GetShortName()); params->Set("service", service->GetShortName());
/*
* If the host/service object specifies the 'check_timeou
t' attribute,
* forward this to the remote endpoint to limit the comma
nd execution time.
*/
if (!GetCheckTimeout().IsEmpty())
params->Set("check_timeout", GetCheckTimeout());
params->Set("macros", macros); params->Set("macros", macros);
ApiListener::Ptr listener = ApiListener::GetInstance(); ApiListener::Ptr listener = ApiListener::GetInstance();
if (listener) if (listener)
listener->SyncSendMessage(endpoint, message); listener->SyncSendMessage(endpoint, message);
/* Re-schedule the check so we don't run it again until a fter we've received /* Re-schedule the check so we don't run it again until a fter we've received
* a check result from the remote instance. The check wil l be re-scheduled * a check result from the remote instance. The check wil l be re-scheduled
* using the proper check interval once we've received a check result. * using the proper check interval once we've received a check result.
 End of changes. 5 change blocks. 
2 lines changed or deleted 34 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)