Module: check_mk
Branch: master
Commit: c9bc7a00d9c98c7eb4b06cff644c76eeba13ca7b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c9bc7a00d9c98c…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Thu Mar 1 15:38:37 2018 +0100
Win-agent: update code comments
The comments contained now outdated information as eventlog state
offsets are no longer preserved in memory but read every time from
file. Related to a1fb8bc3a01beb2687a1cc90fae85195ba952e87.
---
agents/windows/sections/SectionEventlog.cc | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/agents/windows/sections/SectionEventlog.cc
b/agents/windows/sections/SectionEventlog.cc
index 5eb5936..6ba469b 100644
--- a/agents/windows/sections/SectionEventlog.cc
+++ b/agents/windows/sections/SectionEventlog.cc
@@ -434,11 +434,11 @@ void SectionEventlog::handleExistingLog(std::ostream &out,
// the logwatch agent for Linux and UNIX
bool SectionEventlog::produceOutputInner(std::ostream &out) {
Debug(_logger) << "SectionEventlog::produceOutputInner";
- // This agent remembers the record numbers
+ // The agent reads from a state file the record numbers
// of the event logs up to which messages have
- // been processed. When started, the eventlog
- // is skipped to the end. Historic messages are
- // not been processed.
+ // been processed. When no state information is available,
+ // the eventlog is skipped to the end (unless the sendall config
+ // option is used). Historic messages are not been processed.
if (auto states = loadEventlogOffsets(_env.eventlogStatefile(),
*_sendall, _logger);
@@ -448,8 +448,7 @@ bool SectionEventlog::produceOutputInner(std::ostream &out) {
handleExistingLog(out, state);
}
}
- // The offsets are persisted in file after each run as we never know
- // when the agent will be stopped.
+ // The offsets are persisted in a state file.
saveEventlogOffsets(_env.eventlogStatefile(), states);
}