mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-22 21:24:41 +02:00
Config sync: Count the updates and log them
``` [2019-07-10 12:34:27 +0200] information/ApiListener: Received configuration updates (2) from endpoint 'master1' are equal to production, not triggering reload. ```
This commit is contained in:
parent
87d4575af8
commit
b00e1d0c67
@ -301,6 +301,8 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
|
|||||||
Utility::MkDirP(apiZonesStageDir, 0700);
|
Utility::MkDirP(apiZonesStageDir, 0700);
|
||||||
|
|
||||||
// Analyse and process the update.
|
// Analyse and process the update.
|
||||||
|
size_t count = 0;
|
||||||
|
|
||||||
ObjectLock olock(updateV1);
|
ObjectLock olock(updateV1);
|
||||||
|
|
||||||
for (const Dictionary::Pair& kv : 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) {
|
if (configChange) {
|
||||||
Log(LogInformation, "ApiListener")
|
Log(LogInformation, "ApiListener")
|
||||||
<< "Received configuration from endpoint '" << fromEndpointName
|
<< "Received configuration updates (" << count << ") from endpoint '" << fromEndpointName
|
||||||
<< "' is different to production, triggering validation and reload.";
|
<< "' are different to production, triggering validation and reload.";
|
||||||
AsyncTryActivateZonesStage(relativePaths);
|
AsyncTryActivateZonesStage(relativePaths);
|
||||||
} else {
|
} else {
|
||||||
Log(LogInformation, "ApiListener")
|
Log(LogInformation, "ApiListener")
|
||||||
<< "Received configuration from endpoint '" << fromEndpointName
|
<< "Received configuration updates (" << count << ") from endpoint '" << fromEndpointName
|
||||||
<< "' is equal to production, not triggering reload.";
|
<< "' are equal to production, not triggering reload.";
|
||||||
}
|
}
|
||||||
|
|
||||||
return Empty;
|
return Empty;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user