Module: check_mk
Branch: master
Commit: 2725759603cd0810a86e59bf147694eba7ba1743
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2725759603cd08…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 26 10:57:18 2013 +0200
Staleness: show last check time in red if stale
---
web/htdocs/status.css | 4 ++++
web/plugins/views/painters.py | 9 ++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/status.css b/web/htdocs/status.css
index 6fe4b2b..8c74566 100644
--- a/web/htdocs/status.css
+++ b/web/htdocs/status.css
@@ -273,6 +273,10 @@ table.data td.age {
color: #666;
white-space: nowrap;
}
+table.data td.age.staletime {
+ color: red;
+ font-weight: bold;
+}
table.data td.age.recent {
font-weight: bold;
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 5cc842c..463f764 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -490,12 +490,19 @@ multisite_painters["svc_state_age"] = {
"paint" : lambda row:
paint_age(row["service_last_state_change"],
row["service_has_been_checked"] == 1, 60 * 10),
"sorter" : "stateage",
}
+
+def paint_checked(row):
+ css, td = paint_age(row["service_last_check"],
row["service_has_been_checked"] == 1, 0)
+ if is_stale(row):
+ css += " staletime"
+ return css, td
+
multisite_painters["svc_check_age"] = {
"title" : _("The time since the last check of the service"),
"short" : _("Checked"),
"columns" : [ "service_has_been_checked",
"service_last_check" ],
"options" : [ "ts_format", "ts_date" ],
- "paint" : lambda row: paint_age(row["service_last_check"],
row["service_has_been_checked"] == 1, 0),
+ "paint" : paint_checked,
}
multisite_painters["svc_next_check"] = {