]> granicus.if.org Git - icinga2/commitdiff
ApiListener#ApiTimerHandler(): delete all replayed logs
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Wed, 17 Apr 2019 11:52:13 +0000 (13:52 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 16 May 2019 14:32:22 +0000 (16:32 +0200)
refs #6932

(cherry picked from commit 9b489cf9b9347fbce5f5f268d83bba556467e2e9)

lib/remote/apilistener.cpp

index fb2443d0cd1a362f6dc17a51b5b669bbd39788eb..fd2d95cf0c901d50ecc6bd25d6623bae1776e4b2 100644 (file)
@@ -694,11 +694,19 @@ void ApiListener::ApiTimerHandler()
 
        for (int ts : files) {
                bool need = false;
+               auto localZone (GetLocalEndpoint()->GetZone());
 
                for (const Endpoint::Ptr& endpoint : ConfigType::GetObjectsByType<Endpoint>()) {
                        if (endpoint == GetLocalEndpoint())
                                continue;
 
+                       auto zone (endpoint->GetZone());
+
+                       /* only care for endpoints in a) the same zone b) our parent zone c) immediate child zones */
+                       if (!(zone == localZone || zone == localZone->GetParent() || zone->GetParent() == localZone)) {
+                               continue;
+                       }
+
                        if (endpoint->GetLogDuration() >= 0 && ts < now - endpoint->GetLogDuration())
                                continue;