]> granicus.if.org Git - icinga2/commitdiff
Config sync: Count the updates and log them
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 10 Jul 2019 10:34:40 +0000 (12:34 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 15 Jul 2019 07:54:09 +0000 (09:54 +0200)
```
[2019-07-10 12:34:27 +0200] information/ApiListener: Received configuration updates (2) from endpoint 'master1' are equal to production, not triggering reload.
```

lib/remote/apilistener-filesync.cpp

index d1048ff6d44bc3d5daeef9c30a169c09db988a64..5d1412bc28eaf9e582c1ddc3e1bb05c1f255f01c 100644 (file)
@@ -301,6 +301,8 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
        Utility::MkDirP(apiZonesStageDir, 0700);
 
        // Analyse and process the update.
+       size_t count = 0;
+
        ObjectLock olock(updateV1);
 
        for (const Dictionary::Pair& kv : updateV1) {
@@ -480,6 +482,8 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
                                }
                        }
                }
+
+               count++;
        }
 
        /*
@@ -493,13 +497,13 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
         */
        if (configChange) {
                Log(LogInformation, "ApiListener")
-                       << "Received configuration from endpoint '" << fromEndpointName
-                       << "' is different to production, triggering validation and reload.";
+                       << "Received configuration updates (" << count << ") from endpoint '" << fromEndpointName
+                       << "' are different to production, triggering validation and reload.";
                AsyncTryActivateZonesStage(relativePaths);
        } else {
                Log(LogInformation, "ApiListener")
-                       << "Received configuration from endpoint '" << fromEndpointName
-                       << "' is equal to production, not triggering reload.";
+                       << "Received configuration updates (" << count << ") from endpoint '" << fromEndpointName
+                       << "' are equal to production, not triggering reload.";
        }
 
        return Empty;