Module: check_mk
Branch: master
Commit: 5ab523198c453d824c02f53d7038b757f9fced58
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5ab523198c453d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Sep 30 14:47:34 2014 +0200
#1410 Output log text of scheduled downtime log entries
Multisite now shows the text that is attached to a scheduled downtime start/stop in the
monitoring logfile when showing the history of a host or service. Alas, Nagios does not
log anything useful in those entries. The Check_MK Micro Core logs the downtime comment,
which is by that way now visible in the historic views of Multisite.
---
.werks/1410 | 12 ++++++++++++
ChangeLog | 1 +
livestatus/src/LogEntry.cc | 10 +++++-----
web/plugins/views/painters.py | 5 ++++-
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/.werks/1410 b/.werks/1410
new file mode 100644
index 0000000..2577941
--- /dev/null
+++ b/.werks/1410
@@ -0,0 +1,12 @@
+Title: Output log text of scheduled downtime log entries
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i6
+Date: 1412081129
+Class: feature
+
+Multisite now shows the text that is attached to a scheduled downtime start/stop in the
+monitoring logfile when showing the history of a host or service. Alas, Nagios does not
+log anything useful in those entries. The Check_MK Micro Core logs the downtime comment,
+which is by that way now visible in the historic views of Multisite.
diff --git a/ChangeLog b/ChangeLog
index 27bb664..4b077df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -107,6 +107,7 @@
* 1392 WATO Folder filter: show only the paths a user is allowed to see
* 1398 Allow to spread times of next check when rescheduling...
* 1405 Checkbox for settings downtimes on the hosts of the selected services...
+ * 1410 Output log text of scheduled downtime log entries...
* 1067 FIX: Fixed login problem in LDAP connector when no user filter specified...
* 1094 FIX: sidebar snaping 'Tree of folders': fixed exception
* 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after
editing availability options...
diff --git a/livestatus/src/LogEntry.cc b/livestatus/src/LogEntry.cc
index 0c0b7cc..f996309 100644
--- a/livestatus/src/LogEntry.cc
+++ b/livestatus/src/LogEntry.cc
@@ -153,7 +153,7 @@ inline bool LogEntry::handleStatusEntry()
_host_name = next_token(&scan, ';');
_state_type = next_token(&scan, ';');
- _comment = next_token(&scan, ';') + 1;
+ _comment = next_token(&scan, ';');
return true;
}
else if (!strncmp(_text, "HOST FLAPPING ALERT: ", 21))
@@ -166,7 +166,7 @@ inline bool LogEntry::handleStatusEntry()
_host_name = next_token(&scan, ';');
_state_type = next_token(&scan, ';');
- _comment = next_token(&scan, ';') + 1;
+ _comment = next_token(&scan, ';');
return true;
}
@@ -175,7 +175,7 @@ inline bool LogEntry::handleStatusEntry()
|| !strncmp(_text, "CURRENT SERVICE STATE: ", 23)
|| !strncmp(_text, "SERVICE ALERT: ", 15))
{
- if (_text[0] == 'S'){
+ if (_text[0] == 'S') {
_logclass = LOGCLASS_ALERT;
_type = ALERT_SERVICE;
}
@@ -210,7 +210,7 @@ inline bool LogEntry::handleStatusEntry()
_host_name = next_token(&scan, ';');
_svc_desc = next_token(&scan, ';');
_state_type = next_token(&scan, ';');
- _comment = next_token(&scan, ';') + 1;
+ _comment = next_token(&scan, ';');
return true;
}
else if (!strncmp(_text, "SERVICE FLAPPING ALERT: ", 24))
@@ -224,7 +224,7 @@ inline bool LogEntry::handleStatusEntry()
_host_name = next_token(&scan, ';');
_svc_desc = next_token(&scan, ';');
_state_type = next_token(&scan, ';');
- _comment = next_token(&scan, ';') + 1;
+ _comment = next_token(&scan, ';');
return true;
}
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 1cd0f17..dd0daa5 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -1705,8 +1705,11 @@ multisite_painters["log_message"] = {
def paint_log_plugin_output(row):
output = row["log_plugin_output"]
+ comment = row["log_comment"]
if output:
return "", format_plugin_output(output, row)
+ elif comment:
+ return "", comment
else:
log_type = row["log_type"]
lst = row["log_state_type"]
@@ -1729,7 +1732,7 @@ def paint_log_plugin_output(row):
multisite_painters["log_plugin_output"] = {
"title" : _("Log: output of check plugin"),
"short" : _("Check output"),
- "columns" : ["log_plugin_output", "log_type",
"log_state_type" ],
+ "columns" : ["log_plugin_output", "log_type",
"log_state_type", "log_comment" ],
"paint" : paint_log_plugin_output,
}