mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
parent
7b39591c6b
commit
bbcf469af1
@ -80,6 +80,8 @@ void ScheduledDowntime::OnAllConfigLoaded()
|
|||||||
|
|
||||||
if (!GetCheckable())
|
if (!GetCheckable())
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("ScheduledDowntime '" + GetName() + "' references a host/service which doesn't exist.", GetDebugInfo()));
|
BOOST_THROW_EXCEPTION(ScriptError("ScheduledDowntime '" + GetName() + "' references a host/service which doesn't exist.", GetDebugInfo()));
|
||||||
|
|
||||||
|
m_AllConfigLoaded.store(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScheduledDowntime::Start(bool runtimeCreated)
|
void ScheduledDowntime::Start(bool runtimeCreated)
|
||||||
@ -331,3 +333,10 @@ void ScheduledDowntime::ValidateChildOptions(const Lazy<Value>& lvalue, const Va
|
|||||||
BOOST_THROW_EXCEPTION(ValidationError(this, { "child_options" }, "Invalid child_options specified"));
|
BOOST_THROW_EXCEPTION(ValidationError(this, { "child_options" }, "Invalid child_options specified"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ScheduledDowntime::AllConfigIsLoaded()
|
||||||
|
{
|
||||||
|
return m_AllConfigLoaded.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::atomic<bool> ScheduledDowntime::m_AllConfigLoaded (false);
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "icinga/i2-icinga.hpp"
|
#include "icinga/i2-icinga.hpp"
|
||||||
#include "icinga/scheduleddowntime-ti.hpp"
|
#include "icinga/scheduleddowntime-ti.hpp"
|
||||||
#include "icinga/checkable.hpp"
|
#include "icinga/checkable.hpp"
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
@ -47,6 +48,7 @@ public:
|
|||||||
|
|
||||||
static void EvaluateApplyRules(const intrusive_ptr<Host>& host);
|
static void EvaluateApplyRules(const intrusive_ptr<Host>& host);
|
||||||
static void EvaluateApplyRules(const intrusive_ptr<Service>& service);
|
static void EvaluateApplyRules(const intrusive_ptr<Service>& service);
|
||||||
|
static bool AllConfigIsLoaded();
|
||||||
|
|
||||||
void ValidateRanges(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils& utils) override;
|
void ValidateRanges(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils& utils) override;
|
||||||
void ValidateChildOptions(const Lazy<Value>& lvalue, const ValidationUtils& utils) override;
|
void ValidateChildOptions(const Lazy<Value>& lvalue, const ValidationUtils& utils) override;
|
||||||
@ -62,6 +64,8 @@ private:
|
|||||||
std::pair<double, double> FindNextSegment();
|
std::pair<double, double> FindNextSegment();
|
||||||
void CreateNextDowntime();
|
void CreateNextDowntime();
|
||||||
|
|
||||||
|
static std::atomic<bool> m_AllConfigLoaded;
|
||||||
|
|
||||||
static bool EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, const String& name, ScriptFrame& frame, const ApplyRule& rule);
|
static bool EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, const String& name, ScriptFrame& frame, const ApplyRule& rule);
|
||||||
static bool EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyRule& rule);
|
static bool EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyRule& rule);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user