Module: check_mk
Branch: master
Commit: a3974888385aa3bae0b2bdfe0b094d27513add3a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a3974888385aa3…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Aug 2 09:24:17 2017 +0200
5024 FIX Fixed parsing of some host-related monitoring history entries.
Some log lines in the monitoring history were classified incorrectly,
leading to possibly wrong results in e.g. availibility calculations. This
has been fixed.
The affected kind of lines were:
INITIAL HOST STATE
CURRENT HOST STATE
HOST ALERT
Change-Id: Ice7d9a20794fde0bfebacd01e9800b9ad6d6292a
---
.werks/5024 | 18 ++++++++++++++++++
livestatus/src/LogEntry.cc | 10 +++++-----
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/.werks/5024 b/.werks/5024
new file mode 100644
index 0000000..faacfdc
--- /dev/null
+++ b/.werks/5024
@@ -0,0 +1,18 @@
+Title: Fixed parsing of some host-related monitoring history entries.
+Level: 1
+Component: livestatus
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1501658483
+Class: fix
+
+Some log lines in the monitoring history were classified incorrectly,
+leading to possibly wrong results in e.g. availibility calculations. This
+has been fixed.
+
+The affected kind of lines were:
+
+ INITIAL HOST STATE
+ CURRENT HOST STATE
+ HOST ALERT
diff --git a/livestatus/src/LogEntry.cc b/livestatus/src/LogEntry.cc
index f6b526a..a81d923 100644
--- a/livestatus/src/LogEntry.cc
+++ b/livestatus/src/LogEntry.cc
@@ -117,20 +117,20 @@ bool LogEntry::assign(Param par, const string &field) {
// False positive in clang-tidy-4.0, see
https://reviews.llvm.org/D27048
std::vector<LogEntry::LogDef> LogEntry::log_definitions // NOLINT
{LogDef{"INITIAL HOST STATE",
- Class::alert,
- LogEntryType::alert_host,
+ Class::state,
+ LogEntryType::state_host_initial,
{Param::HostName, Param::HostState, Param::StateType,
Param::Attempt, Param::CheckOutput}},
////////////////
LogDef{"CURRENT HOST STATE",
Class::state,
- LogEntryType::state_host_initial,
+ LogEntryType::state_host,
{Param::HostName, Param::HostState, Param::StateType,
Param::Attempt, Param::CheckOutput}},
////////////////
LogDef{"HOST ALERT",
- Class::state,
- LogEntryType::state_host,
+ Class::alert,
+ LogEntryType::alert_host,
{Param::HostName, Param::HostState, Param::StateType,
Param::Attempt, Param::CheckOutput}},
////////////////