Merge pull request #9822 from Icinga/2.13.8/bugfix/cluster-zone-own-zone-8570

cluster-zone: consider own zone connected if there's only one endpoint
This commit is contained in:
Alexander Aleksandrovič Klimov 2023-07-06 14:24:52 +02:00 committed by GitHub
commit 8cd11a9146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,7 +139,10 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che
double bytesSentPerSecond = 0;
double bytesReceivedPerSecond = 0;
for (const Endpoint::Ptr& endpoint : zone->GetEndpoints()) {
{
auto endpoints (zone->GetEndpoints());
for (const Endpoint::Ptr& endpoint : endpoints) {
if (endpoint->GetConnected())
connected = true;
@ -160,6 +163,11 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che
bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond();
}
if (!connected && endpoints.size() == 1u && *endpoints.begin() == Endpoint::GetLocalEndpoint()) {
connected = true;
}
}
ServiceState state;
String output;