mirror of https://github.com/Icinga/icinga2.git
Implement previous_state_change
This commit is contained in:
parent
09dfdaa71b
commit
93030709f5
|
@ -256,6 +256,9 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||||
else
|
else
|
||||||
stateChange = (Host::CalculateState(old_state) != Host::CalculateState(new_state));
|
stateChange = (Host::CalculateState(old_state) != Host::CalculateState(new_state));
|
||||||
|
|
||||||
|
/* Store the current last state change for the next iteration. */
|
||||||
|
SetPreviousStateChange(GetLastStateChange());
|
||||||
|
|
||||||
if (stateChange) {
|
if (stateChange) {
|
||||||
SetLastStateChange(now);
|
SetLastStateChange(now);
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,9 @@ abstract class Checkable : CustomVarObject
|
||||||
};
|
};
|
||||||
[state] Timestamp last_state_unreachable;
|
[state] Timestamp last_state_unreachable;
|
||||||
|
|
||||||
|
[state] Timestamp previous_state_change {
|
||||||
|
default {{{ return Application::GetStartTime(); }}}
|
||||||
|
};
|
||||||
[no_storage] int severity {
|
[no_storage] int severity {
|
||||||
get;
|
get;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue