Module: check_mk
Branch: master
Commit: 8e308c9fd52b491fbb958ddb1e836949ae4dde7c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8e308c9fd52b49…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Aug 28 11:04:37 2017 +0200
Fixed alert statistics view editing
Change-Id: I615f5c3cb085697b25240bda6ba3ac551bc32daa
---
web/plugins/views/datasources.py | 2 +-
web/plugins/views/painters.py | 20 ++++++++++----------
web/plugins/views/sorters.py | 10 +++++-----
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/web/plugins/views/datasources.py b/web/plugins/views/datasources.py
index 058358f..62d41e9 100644
--- a/web/plugins/views/datasources.py
+++ b/web/plugins/views/datasources.py
@@ -233,7 +233,7 @@ multisite_datasources["alert_stats"] = {
"title" : _("Alert Statistics"),
"table" : "log",
"add_headers" : "Filter: class = 1\nStats: state = 0\nStats: state =
1\nStats: state = 2\nStats: state = 3\nStats: state != 0\n",
- "add_columns" : [ "alerts_ok", "alerts_warn",
"alerts_crit", "alerts_unknown", "alerts_problem" ],
+ "add_columns" : [ "log_alerts_ok", "log_alerts_warn",
"log_alerts_crit", "log_alerts_unknown",
"log_alerts_problem" ],
"infos" : [ "log", "host", "service",
"contact", "command" ],
"keys" : [],
"idkeys" : [ 'host_name', 'service_description' ],
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 3bbdd64..e0d39e3 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -2483,36 +2483,36 @@ multisite_painters["log_state"] = {
multisite_painters["alert_stats_ok"] = {
"title" : _("Alert Statistics: Number of recoveries"),
"short" : _("OK"),
- "columns" : [ "alerts_ok" ],
- "paint" : lambda row: ("", str(row["alerts_ok"])),
+ "columns" : [ "log_alerts_ok" ],
+ "paint" : lambda row: ("",
str(row["log_alerts_ok"])),
}
multisite_painters["alert_stats_warn"] = {
"title" : _("Alert Statistics: Number of warnings"),
"short" : _("WARN"),
- "columns" : [ "alerts_warn" ],
- "paint" : lambda row: paint_svc_count(1, row["alerts_warn"]),
+ "columns" : [ "log_alerts_warn" ],
+ "paint" : lambda row: paint_svc_count(1,
row["log_alerts_warn"]),
}
multisite_painters["alert_stats_crit"] = {
"title" : _("Alert Statistics: Number of critical alerts"),
"short" : _("CRIT"),
- "columns" : [ "alerts_crit" ],
- "paint" : lambda row: paint_svc_count(2, row["alerts_crit"])
+ "columns" : [ "log_alerts_crit" ],
+ "paint" : lambda row: paint_svc_count(2, row["log_alerts_crit"])
}
multisite_painters["alert_stats_unknown"] = {
"title" : _("Alert Statistics: Number of unknown alerts"),
"short" : _("UNKN"),
- "columns" : [ "alerts_unknown" ],
- "paint" : lambda row: paint_svc_count(3, row["alerts_unknown"])
+ "columns" : [ "log_alerts_unknown" ],
+ "paint" : lambda row: paint_svc_count(3,
row["log_alerts_unknown"])
}
multisite_painters["alert_stats_problem"] = {
"title" : _("Alert Statistics: Number of problem alerts"),
"short" : _("PROB"),
- "columns" : [ "alerts_problem" ],
- "paint" : lambda row: paint_svc_count('s',
row["alerts_problem"])
+ "columns" : [ "log_alerts_problem" ],
+ "paint" : lambda row: paint_svc_count('s',
row["log_alerts_problem"])
}
#
diff --git a/web/plugins/views/sorters.py b/web/plugins/views/sorters.py
index b26bbc1..468cd28 100644
--- a/web/plugins/views/sorters.py
+++ b/web/plugins/views/sorters.py
@@ -382,11 +382,11 @@ def cmp_date(column, r1, r2):
declare_1to1_sorter("log_date", cmp_date)
# Alert statistics
-declare_simple_sorter("alerts_ok", _("Number of recoveries"),
"alerts_ok", cmp_simple_number)
-declare_simple_sorter("alerts_warn", _("Number of warnings"),
"alerts_warn", cmp_simple_number)
-declare_simple_sorter("alerts_crit", _("Number of critical
alerts"), "alerts_crit", cmp_simple_number)
-declare_simple_sorter("alerts_unknown", _("Number of unknown
alerts"), "alerts_unknown", cmp_simple_number)
-declare_simple_sorter("alerts_problem", _("Number of problem
alerts"), "alerts_problem", cmp_simple_number)
+declare_simple_sorter("alerts_ok", _("Number of recoveries"),
"log_alerts_ok", cmp_simple_number)
+declare_simple_sorter("alerts_warn", _("Number of warnings"),
"log_alerts_warn", cmp_simple_number)
+declare_simple_sorter("alerts_crit", _("Number of critical
alerts"), "log_alerts_crit", cmp_simple_number)
+declare_simple_sorter("alerts_unknown", _("Number of unknown
alerts"), "log_alerts_unknown", cmp_simple_number)
+declare_simple_sorter("alerts_problem", _("Number of problem
alerts"), "log_alerts_problem", cmp_simple_number)
# Aggregations
declare_simple_sorter("aggr_name", _("Aggregation name"),
"aggr_name", cmp_simple_string)