mirror of https://github.com/Icinga/icinga2.git
parent
e09fb88cae
commit
8389d01998
|
@ -153,6 +153,10 @@ void Checkable::NotifyDowntimeInternal(const Downtime::Ptr& downtime)
|
||||||
|
|
||||||
void Checkable::NotifyDowntimeEnd(const Downtime::Ptr& downtime)
|
void Checkable::NotifyDowntimeEnd(const Downtime::Ptr& downtime)
|
||||||
{
|
{
|
||||||
|
/* don't send notifications for flexible downtimes which never triggered */
|
||||||
|
if (!downtime->GetFixed() && !downtime->IsTriggered())
|
||||||
|
return;
|
||||||
|
|
||||||
Checkable::Ptr checkable = downtime->GetCheckable();
|
Checkable::Ptr checkable = downtime->GetCheckable();
|
||||||
|
|
||||||
if (!checkable->IsPaused())
|
if (!checkable->IsPaused())
|
||||||
|
|
|
@ -180,7 +180,20 @@ bool Downtime::IsTriggered(void) const
|
||||||
|
|
||||||
bool Downtime::IsExpired(void) const
|
bool Downtime::IsExpired(void) const
|
||||||
{
|
{
|
||||||
return (GetEndTime() < Utility::GetTime());
|
double now = Utility::GetTime();
|
||||||
|
|
||||||
|
if (GetFixed())
|
||||||
|
return (GetEndTime() < now);
|
||||||
|
else {
|
||||||
|
/* triggered flexible downtime not in effect anymore */
|
||||||
|
if (IsTriggered() && !IsInEffect())
|
||||||
|
return true;
|
||||||
|
/* flexible downtime never triggered */
|
||||||
|
else if (!IsTriggered() && (GetEndTime() < now))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Downtime::GetNextDowntimeID(void)
|
int Downtime::GetNextDowntimeID(void)
|
||||||
|
|
Loading…
Reference in New Issue