mirror of https://github.com/Icinga/icinga2.git
Only create downtimes from non-paused ScheduledDowntime objects in HA enabled cluster zones
This commit is contained in:
parent
7b39591c6b
commit
fd9b2dece1
|
@ -95,13 +95,14 @@ void ScheduledDowntime::Start(bool runtimeCreated)
|
||||||
l_Timer->Start();
|
l_Timer->Start();
|
||||||
});
|
});
|
||||||
|
|
||||||
Utility::QueueAsyncCallback(std::bind(&ScheduledDowntime::CreateNextDowntime, this));
|
if (!IsPaused())
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,6 +236,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;
|
||||||
|
}
|
||||||
|
|
||||||
double minEnd = 0;
|
double minEnd = 0;
|
||||||
|
|
||||||
for (const Downtime::Ptr& downtime : GetCheckable()->GetDowntimes()) {
|
for (const Downtime::Ptr& downtime : GetCheckable()->GetDowntimes()) {
|
||||||
|
|
Loading…
Reference in New Issue