Module: check_mk
Branch: master
Commit: ad07f9b6b126f05f94b8cf58dce2d73c6ee10207
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ad07f9b6b126f0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 9 17:37:52 2018 +0100
Add new host/service painters to display the notification postponement reasons of the
Microcore
Change-Id: If97eab3df61c85da4b10d63c1efee0cd23de05b2
---
web/plugins/views/builtin.py | 6 ++++--
web/plugins/views/painters.py | 47 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py
index 2ce574a..9f1536d 100644
--- a/web/plugins/views/builtin.py
+++ b/web/plugins/views/builtin.py
@@ -1129,8 +1129,9 @@ multisite_builtin_views.update({
('host_notifper', None),
('host_in_notifper', None),
('host_notification_number', None),
- ('host_next_notification', None),
('host_last_notification', None),
+ ('host_next_notification', None),
+ ('host_notification_postponement_reason', None),
# 5. Configuration
('host_check_interval', None),
@@ -1331,8 +1332,9 @@ multisite_builtin_views.update({
('svc_notifper', None),
('svc_in_notifper', None),
('svc_notification_number', None),
- ('svc_next_notification', None),
('svc_last_notification', None),
+ ('svc_next_notification', None),
+ ('svc_notification_postponement_reason', None),
# 5. Configuration
('svc_check_interval', None),
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 083c03a..ad3ffd4 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -857,6 +857,46 @@ multisite_painters["svc_next_notification"] = {
"paint" : lambda row:
paint_future_time(row["service_next_notification"]),
}
+def paint_notification_postponement_reason(what, row):
+ # Needs to be in sync with the possible reasons. Can not be translaated otherwise.
+ reasons = {
+ "delayed notification":
+ _("Delay notification"),
+ "periodic notification":
+ _("Periodic notification"),
+ "currently in downtime":
+ _("In downtime"),
+ "host of this service is currently in downtime":
+ _("Host is in downtime"),
+ "problem acknowledged and periodic notifications are enabled":
+ _("Problem is acknowledged, but is configured to be periodic"),
+ "notifications are disabled, but periodic notifications are enabled":
+ _("Notifications are disabled, but is configured to be periodic"),
+ "not in notification period":
+ _("Is not in notification period"),
+ "host of this service is not up":
+ _("Host is down"),
+ "last host check not recent enough":
+ _("Last host check is not recent enough"),
+ "last service check not recent enough":
+ _("Last service check is not recent enough"),
+ "all parents are down":
+ _("All parents are down"),
+ "at least one parent is up, but no check is recent enough":
+ _("Last service check is not recent enough"),
+ }
+
+ return "", \
+ reasons.get(row[what + "_notification_postponement_reason"],
+ row[what + "_notification_postponement_reason"])
+
+multisite_painters["svc_notification_postponement_reason"] = {
+ "title" : _("Notification postponement reason"),
+ "short" : _("Notif. postponed"),
+ "columns" : [ "service_notification_postponement_reason" ],
+ "paint" : lambda row:
paint_notification_postponement_reason("service", row),
+}
+
multisite_painters["svc_last_notification"] = {
"title" : _("The time of the last service notification"),
"short" : _("last notification"),
@@ -1345,6 +1385,13 @@ multisite_painters["host_next_notification"] = {
"paint" : lambda row:
paint_future_time(row["host_next_notification"]),
}
+multisite_painters["host_notification_postponement_reason"] = {
+ "title" : _("Notification postponement reason"),
+ "short" : _("Notif. postponed"),
+ "columns" : [ "host_notification_postponement_reason" ],
+ "paint" : lambda row:
paint_notification_postponement_reason("host", row),
+}
+
multisite_painters["host_last_notification"] = {
"title" : _("The time of the last host notification"),
"short" : _("last notification"),