Merge pull request #7050 from Icinga/feature/previous-state-change

Implement previous_state_change
This commit is contained in:
Michael Friedrich 2019-04-17 13:17:41 +02:00 committed by GitHub
commit 02db12ae02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -256,6 +256,9 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
else
stateChange = (Host::CalculateState(old_state) != Host::CalculateState(new_state));
/* Store the current last state change for the next iteration. */
SetPreviousStateChange(GetLastStateChange());
if (stateChange) {
SetLastStateChange(now);

View File

@ -120,6 +120,9 @@ abstract class Checkable : CustomVarObject
};
[state] Timestamp last_state_unreachable;
[state] Timestamp previous_state_change {
default {{{ return Application::GetStartTime(); }}}
};
[no_storage] int severity {
get;
};