MCPcopy Create free account
hub / github.com/Icinga/icinga2 / InNotificationPeriodAccessor

Method InNotificationPeriodAccessor

lib/livestatus/servicestable.cpp:896–911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

894}
895
896Value ServicesTable::InNotificationPeriodAccessor(const Value& row)
897{
898 Service::Ptr service = static_cast<Service::Ptr>(row);
899
900 if (!service)
901 return Empty;
902
903 for (const Notification::Ptr& notification : service->GetNotifications()) {
904 TimePeriod::Ptr timeperiod = notification->GetPeriod();
905
906 if (!timeperiod || timeperiod->IsInside(Utility::GetTime()))
907 return 1;
908 }
909
910 return 0;
911}
912
913Value ServicesTable::ContactsAccessor(const Value& row)
914{

Callers

nothing calls this directly

Calls 3

IsInsideMethod · 0.80
GetNotificationsMethod · 0.45
GetPeriodMethod · 0.45

Tested by

no test coverage detected