mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
Log a warning if there are more than 2 zone endpoint members
fixes #12222
This commit is contained in:
parent
f2bacb2697
commit
55a3dc22bf
@ -21,6 +21,7 @@
|
|||||||
#include "remote/zone.tcpp"
|
#include "remote/zone.tcpp"
|
||||||
#include "remote/jsonrpcconnection.hpp"
|
#include "remote/jsonrpcconnection.hpp"
|
||||||
#include "base/objectlock.hpp"
|
#include "base/objectlock.hpp"
|
||||||
|
#include "base/logger.hpp"
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
@ -121,3 +122,14 @@ Zone::Ptr Zone::GetLocalZone(void)
|
|||||||
return local->GetZone();
|
return local->GetZone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Zone::ValidateEndpointsRaw(const Array::Ptr& value, const ValidationUtils& utils)
|
||||||
|
{
|
||||||
|
ObjectImpl<Zone>::ValidateEndpointsRaw(value, utils);
|
||||||
|
|
||||||
|
if (value && value->GetLength() > 2) {
|
||||||
|
Log(LogWarning, "Zone")
|
||||||
|
<< "The Zone object '" << GetName() << "' has more than two endpoints."
|
||||||
|
<< " Due to a known issue this type of configuration is strongly"
|
||||||
|
<< " discouraged and may cause Icinga to use excessive amounts of CPU time.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -48,6 +48,9 @@ public:
|
|||||||
|
|
||||||
static Zone::Ptr GetLocalZone(void);
|
static Zone::Ptr GetLocalZone(void);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void ValidateEndpointsRaw(const Array::Ptr& value, const ValidationUtils& utils) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Zone::Ptr m_Parent;
|
Zone::Ptr m_Parent;
|
||||||
std::vector<Zone::Ptr> m_AllParents;
|
std::vector<Zone::Ptr> m_AllParents;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user