return Empty;
}
-/* Used in Livestatus. */
-int CompatUtility::GetCheckableInNotificationPeriod(const Checkable::Ptr& checkable)
-{
- for (const Notification::Ptr& notification : checkable->GetNotifications()) {
- TimePeriod::Ptr timeperiod = notification->GetPeriod();
-
- if (!timeperiod || timeperiod->IsInside(Utility::GetTime()))
- return 1;
- }
-
- return 0;
-}
-
/* Used in DB IDO, StatusDataWriter and Livestatus. */
int CompatUtility::GetCheckableNotificationLastNotification(const Checkable::Ptr& checkable)
{
/* service */
static String GetCheckableCommandArgs(const Checkable::Ptr& checkable);
- static int GetCheckableInNotificationPeriod(const Checkable::Ptr& checkable);
-
/* notification */
static int GetCheckableNotificationsEnabled(const Checkable::Ptr& checkable);
static int GetCheckableNotificationLastNotification(const Checkable::Ptr& checkable);
if (!host)
return Empty;
- return CompatUtility::GetCheckableInNotificationPeriod(host);
+ for (const Notification::Ptr& notification : host->GetNotifications()) {
+ TimePeriod::Ptr timeperiod = notification->GetPeriod();
+
+ if (!timeperiod || timeperiod->IsInside(Utility::GetTime()))
+ return 1;
+ }
+
+ return 0;
}
Value HostsTable::InCheckPeriodAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCheckableInNotificationPeriod(service);
+ for (const Notification::Ptr& notification : service->GetNotifications()) {
+ TimePeriod::Ptr timeperiod = notification->GetPeriod();
+
+ if (!timeperiod || timeperiod->IsInside(Utility::GetTime()))
+ return 1;
+ }
+
+ return 0;
}
Value ServicesTable::ContactsAccessor(const Value& row)