mirror of https://github.com/Icinga/icinga2.git
parent
55641fc1ea
commit
92c8d71bf3
|
@ -56,17 +56,14 @@ void NotificationComponent::NotificationTimerHandler(void)
|
||||||
double now = Utility::GetTime();
|
double now = Utility::GetTime();
|
||||||
|
|
||||||
BOOST_FOREACH(const Notification::Ptr& notification, DynamicType::GetObjects<Notification>()) {
|
BOOST_FOREACH(const Notification::Ptr& notification, DynamicType::GetObjects<Notification>()) {
|
||||||
if (notification->GetNotificationInterval() <= 0)
|
Service::Ptr service = notification->GetService();
|
||||||
|
|
||||||
|
if (notification->GetNotificationInterval() <= 0 && notification->GetLastProblemNotification() < service->GetLastHardStateChange())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (notification->GetNextNotification() > now)
|
if (notification->GetNextNotification() > now)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Service::Ptr service = notification->GetService();
|
|
||||||
|
|
||||||
if (!service)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
bool reachable = service->IsReachable();
|
bool reachable = service->IsReachable();
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -107,5 +104,5 @@ void NotificationComponent::NotificationTimerHandler(void)
|
||||||
void NotificationComponent::SendNotificationsHandler(const Service::Ptr& service, NotificationType type,
|
void NotificationComponent::SendNotificationsHandler(const Service::Ptr& service, NotificationType type,
|
||||||
const CheckResult::Ptr& cr, const String& author, const String& text)
|
const CheckResult::Ptr& cr, const String& author, const String& text)
|
||||||
{
|
{
|
||||||
service->SendNotifications(static_cast<NotificationType>(type), cr, author, text);
|
service->SendNotifications(type, cr, author, text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,11 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
|
||||||
{
|
{
|
||||||
ObjectLock olock(this);
|
ObjectLock olock(this);
|
||||||
|
|
||||||
SetLastNotification(Utility::GetTime());
|
double now = Utility::GetTime();
|
||||||
|
SetLastNotification(now);
|
||||||
|
|
||||||
|
if (type == NotificationProblem)
|
||||||
|
SetLastProblemNotification(now);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<User::Ptr> allUsers;
|
std::set<User::Ptr> allUsers;
|
||||||
|
|
|
@ -26,6 +26,7 @@ class Notification : DynamicObject
|
||||||
[state] double last_notification;
|
[state] double last_notification;
|
||||||
[state, set_protected] double next_notification (NextNotificationRaw);
|
[state, set_protected] double next_notification (NextNotificationRaw);
|
||||||
[state, set_protected] Value notification_number;
|
[state, set_protected] Value notification_number;
|
||||||
|
[state] double last_problem_notification;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue