Module: check_mk
Branch: master
Commit: 50946e1beb110a6b1c0baeaaa4f1d6cc074a0b9d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=50946e1beb110a…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Tue Feb 27 15:09:35 2018 +0100
Win-agent: output eventlog state with stream operator
---
agents/windows/build_version | 2 +-
agents/windows/sections/SectionEventlog.cc | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 7a7d1ab..30aafae 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-3128
+3130
diff --git a/agents/windows/sections/SectionEventlog.cc
b/agents/windows/sections/SectionEventlog.cc
index 4b3e688..aaee8c0 100644
--- a/agents/windows/sections/SectionEventlog.cc
+++ b/agents/windows/sections/SectionEventlog.cc
@@ -111,6 +111,11 @@ std::pair<uint64_t, EventlogLevel> processEventLog(
return {lastRecordId, worstState};
}
+inline std::ostream &operator<<(std::ostream &out,
+ const eventlog_file_state &state) {
+ return out << state.name << "|" << state.record_no;
+}
+
} // namespace
eventlog_hint_t parseStateLine(const std::string &line) {
@@ -210,7 +215,7 @@ void SectionEventlog::saveEventlogOffsets(const std::string
&statefile) {
EventlogLevel level{EventlogLevel::Warn};
std::tie(level, std::ignore) = readConfig(state);
if (level != EventlogLevel::Off) {
- ofs << state.name << "|" << state.record_no
<< std::endl;
+ ofs << state << std::endl;
}
}
}