Implement previous_state_change

This commit is contained in:
Michael Friedrich 2019-03-27 11:43:14 +01:00
parent 09dfdaa71b
commit 93030709f5
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;
};