Add Checkable#problem and #handled

This commit is contained in:
Alexander A. Klimov 2019-04-09 11:34:59 +02:00
parent d33cfdf3c0
commit 896d447e11
3 changed files with 18 additions and 0 deletions

View File

@ -144,6 +144,16 @@ bool Checkable::GetReachable() const
return IsReachable();
}
bool Checkable::GetProblem() const
{
return !IsStateOK(GetStateRaw());
}
bool Checkable::GetHandled() const
{
return GetProblem() && (IsInDowntime() || IsAcknowledged());
}
void Checkable::NotifyFixedDowntimeStart(const Downtime::Ptr& downtime)
{
if (!downtime->GetFixed())

View File

@ -86,6 +86,8 @@ public:
int GetSeverity() const override;
bool GetReachable() const override;
bool GetProblem() const override;
bool GetHandled() const override;
/* Checks */
intrusive_ptr<CheckCommand> GetCheckCommand() const;

View File

@ -126,6 +126,12 @@ abstract class Checkable : CustomVarObject
[no_storage] bool reachable {
get;
};
[no_storage] bool problem {
get;
};
[no_storage] bool handled {
get;
};
[state] bool force_next_check;
[state] int acknowledgement (AcknowledgementRaw) {