mirror of https://github.com/Icinga/icinga2.git
parent
47479ac4de
commit
b5dbc66b22
|
@ -586,6 +586,11 @@ Configuration Attributes:
|
|||
The `/etc/icinga2/conf.d/timeperiods.conf` file is usually used to define
|
||||
timeperiods including this one.
|
||||
|
||||
Runtime Attributes:
|
||||
|
||||
Name | Type | Description
|
||||
--------------------------|---------------|-----------------
|
||||
is\_insidek | Boolean | Whether we're currently inside this timeperiod.
|
||||
|
||||
## <a id="objecttype-scheduleddowntime"></a> ScheduledDowntime
|
||||
|
||||
|
|
|
@ -217,6 +217,11 @@ void TimePeriod::UpdateRegion(double begin, double end, bool clearExisting)
|
|||
}
|
||||
}
|
||||
|
||||
bool TimePeriod::GetIsInside(void) const
|
||||
{
|
||||
return IsInside(Utility::GetTime());
|
||||
}
|
||||
|
||||
bool TimePeriod::IsInside(double ts) const
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
|
|
|
@ -43,6 +43,8 @@ public:
|
|||
|
||||
void UpdateRegion(double begin, double end, bool clearExisting);
|
||||
|
||||
virtual bool GetIsInside(void) const;
|
||||
|
||||
bool IsInside(double ts) const;
|
||||
double FindNextTransition(double begin);
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@ class TimePeriod : CustomVarObject
|
|||
[state] Value valid_begin;
|
||||
[state] Value valid_end;
|
||||
[state] Array::Ptr segments;
|
||||
[no_storage] bool is_inside {
|
||||
get;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue