mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Only create downtimes from non-paused ScheduledDowntime objects in HA enabled cluster zones
This commit is contained in:
parent
1d6cec5a99
commit
78e470996d
@ -95,13 +95,14 @@ void ScheduledDowntime::Start(bool runtimeCreated)
|
|||||||
l_Timer->Start();
|
l_Timer->Start();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!IsPaused())
|
||||||
Utility::QueueAsyncCallback(std::bind(&ScheduledDowntime::CreateNextDowntime, this));
|
Utility::QueueAsyncCallback(std::bind(&ScheduledDowntime::CreateNextDowntime, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScheduledDowntime::TimerProc()
|
void ScheduledDowntime::TimerProc()
|
||||||
{
|
{
|
||||||
for (const ScheduledDowntime::Ptr& sd : ConfigType::GetObjectsByType<ScheduledDowntime>()) {
|
for (const ScheduledDowntime::Ptr& sd : ConfigType::GetObjectsByType<ScheduledDowntime>()) {
|
||||||
if (sd->IsActive())
|
if (sd->IsActive() && !sd->IsPaused())
|
||||||
sd->CreateNextDowntime();
|
sd->CreateNextDowntime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,6 +168,13 @@ std::pair<double, double> ScheduledDowntime::FindNextSegment()
|
|||||||
|
|
||||||
void ScheduledDowntime::CreateNextDowntime()
|
void ScheduledDowntime::CreateNextDowntime()
|
||||||
{
|
{
|
||||||
|
/* HA enabled zones. */
|
||||||
|
if (IsActive() && IsPaused()) {
|
||||||
|
Log(LogNotice, "Checkable")
|
||||||
|
<< "Skipping downtime creation for HA-paused Scheduled Downtime object '" << GetName() << "'";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const Downtime::Ptr& downtime : GetCheckable()->GetDowntimes()) {
|
for (const Downtime::Ptr& downtime : GetCheckable()->GetDowntimes()) {
|
||||||
if (downtime->GetScheduledBy() != GetName() ||
|
if (downtime->GetScheduledBy() != GetName() ||
|
||||||
downtime->GetStartTime() < Utility::GetTime())
|
downtime->GetStartTime() < Utility::GetTime())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user