Module: check_mk
Branch: master
Commit: 45eb1c8a72bb10255b9991e721d28f504e53d4a3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=45eb1c8a72bb10…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 21 21:45:55 2012 +0100
Events view now shows icon and text for "flapping" events
---
ChangeLog | 3 ++-
web/htdocs/images/icon_flapping.gif | Bin 1037 -> 1037 bytes
web/plugins/views/painters.py | 26 ++++++++++++++++++++++++--
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 399296a..2c1ac63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,7 +49,7 @@
(this prevents an exception of pfSense)
Multisite:
- * Added several missing localization stringsw
+ * Added several missing localization strings
* IE: Fixed problem with clicking SELECT fields in the new wato foldertree snapin
* Fixed problem when trying to visit dashboards from new wato foldertree snapin
* Chrome: Fixed styling problem of foldertree snapin
@@ -64,6 +64,7 @@
automatically logged out after showing the error message
* Retry livestatus connect until timeout is used up. This avoids
error messages when the core is being restarted
+ * Events view now shows icon and text for "flapping" events
BI:
diff --git a/web/htdocs/images/icon_flapping.gif b/web/htdocs/images/icon_flapping.gif
index 2429db2..e259ff8 100644
Binary files a/web/htdocs/images/icon_flapping.gif and
b/web/htdocs/images/icon_flapping.gif differ
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index bc6e828..acdfa9d 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -1554,11 +1554,31 @@ multisite_painters["log_message"] = {
"paint" : lambda row: ("", row["log_message"]),
}
+def paint_log_plugin_output(row):
+ output = row["log_plugin_output"]
+ if output:
+ return "", format_plugin_output(row, output)
+ else:
+ log_type = row["log_type"]
+ lst = row["log_state_type"]
+ if "FLAPPING" in log_type:
+ if "HOST" in log_type:
+ what = _("host")
+ else:
+ what = _("service")
+ if lst == "STOPPED":
+ return "", _("The %s stopped flapping") % what
+ else:
+ return "", _("The %s started flapping") % what
+
+ return "", (lst + " - " + log_type)
+
+
multisite_painters["log_plugin_output"] = {
"title" : _("Log: output of check plugin"),
"short" : _("Check output"),
- "columns" : ["log_plugin_output"],
- "paint" : lambda row: ("", format_plugin_output(row,
row["log_plugin_output"])),
+ "columns" : ["log_plugin_output", "log_type",
"log_state_type" ],
+ "paint" : paint_log_plugin_output,
}
multisite_painters["log_attempt"] = {
@@ -1607,6 +1627,8 @@ def paint_log_icon(row):
img = "start"
elif "shutdown..." in log_type:
img = "stop"
+ elif " FLAPPING " in log_type:
+ img = "flapping"
if img:
return "icon", '<img
src="images/alert_%s.png">' % img