******************************************************************************/
#include "icinga/checkable.hpp"
+#include "config/configcompilercontext.hpp"
#include "base/objectlock.hpp"
#include "base/utility.hpp"
+#include "base/scriptfunction.hpp"
#include <boost/foreach.hpp>
#include <boost/bind/apply.hpp>
using namespace icinga;
REGISTER_TYPE(Checkable);
+REGISTER_SCRIPTFUNCTION(ValidateCheckableCheckInterval, &Checkable::ValidateCheckInterval);
boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> Checkable::OnEnablePerfdataChanged;
boost::signals2::signal<void (const Checkable::Ptr&, const String&, const String&, AcknowledgementType, double, const MessageOrigin&)> Checkable::OnAcknowledgementSet;
{
return Endpoint::GetByName(GetCommandEndpointRaw());
}
+
+void Checkable::ValidateCheckInterval(const String& location, const Checkable::Ptr& object)
+{
+ if (object->GetCheckInterval() <= 0) {
+ ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
+ location + ": check_interval must be greater than 0.");
+ }
+}
void RemoveReverseDependency(const intrusive_ptr<Dependency>& dep);
std::set<intrusive_ptr<Dependency> > GetReverseDependencies(void) const;
+ static void ValidateCheckInterval(const String& location, const Checkable::Ptr& object);
+
protected:
virtual void Start(void);