mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Merge pull request #7534 from Icinga/feature/next_update
Introduce Checkable#next_update
This commit is contained in:
commit
89b8a8060f
@ -406,6 +406,7 @@ Runtime Attributes:
|
||||
severity | Number | [Severity](19-technical-concepts.md#technical-concepts-checks-severity) calculated value.
|
||||
problem | Boolean | Whether the host is considered in a problem state type (NOT-UP).
|
||||
handled | Boolean | Whether the host problem is handled (downtime or acknowledgement).
|
||||
next\_update | Timestamp | When the next check update is to be expected.
|
||||
|
||||
|
||||
|
||||
@ -770,6 +771,7 @@ Runtime Attributes:
|
||||
severity | Number | [Severity](19-technical-concepts.md#technical-concepts-checks-severity) calculated value.
|
||||
problem | Boolean | Whether the service is considered in a problem state type (NOT-OK).
|
||||
handled | Boolean | Whether the service problem is handled (downtime or acknowledgement).
|
||||
next\_update | Timestamp | When the next check update is to be expected.
|
||||
|
||||
|
||||
### ServiceGroup <a id="objecttype-servicegroup"></a>
|
||||
|
@ -168,6 +168,19 @@ bool Checkable::GetHandled() const
|
||||
return GetProblem() && (IsInDowntime() || IsAcknowledged());
|
||||
}
|
||||
|
||||
Timestamp Checkable::GetNextUpdate() const
|
||||
{
|
||||
auto cr (GetLastCheckResult());
|
||||
|
||||
if (cr) {
|
||||
return GetNextCheck()
|
||||
+ (GetProblem() && GetStateType() == StateTypeSoft ? GetRetryInterval() : GetCheckInterval())
|
||||
+ 2 * (cr->GetExecutionEnd() - cr->GetScheduleStart());
|
||||
} else {
|
||||
return GetNextCheck() + GetCheckInterval();
|
||||
}
|
||||
}
|
||||
|
||||
void Checkable::NotifyFixedDowntimeStart(const Downtime::Ptr& downtime)
|
||||
{
|
||||
if (!downtime->GetFixed())
|
||||
|
@ -91,6 +91,7 @@ public:
|
||||
int GetSeverity() const override;
|
||||
bool GetProblem() const override;
|
||||
bool GetHandled() const override;
|
||||
Timestamp GetNextUpdate() const override;
|
||||
|
||||
/* Checks */
|
||||
intrusive_ptr<CheckCommand> GetCheckCommand() const;
|
||||
|
@ -132,6 +132,9 @@ abstract class Checkable : CustomVarObject
|
||||
[no_storage] bool handled {
|
||||
get;
|
||||
};
|
||||
[no_storage] Timestamp next_update {
|
||||
get;
|
||||
};
|
||||
|
||||
[state] bool force_next_check;
|
||||
[state] int acknowledgement (AcknowledgementRaw) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user