Module: check_mk
Branch: master
Commit: 1a493cf636d3488cd1a3905bc95111c79680ccef
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a493cf636d348…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Feb 28 10:54:00 2014 +0100
RBN: Nicer display of notification types in analyser
---
web/htdocs/images/icon_ack.png | Bin 0 -> 4736 bytes
web/htdocs/images/icon_flapping.png | Bin 0 -> 843 bytes
web/htdocs/wato.py | 30 +++++++++++++++++++++++++++++-
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/images/icon_ack.png b/web/htdocs/images/icon_ack.png
new file mode 100644
index 0000000..a359543
Binary files /dev/null and b/web/htdocs/images/icon_ack.png differ
diff --git a/web/htdocs/images/icon_flapping.png b/web/htdocs/images/icon_flapping.png
new file mode 100644
index 0000000..ce000d7
Binary files /dev/null and b/web/htdocs/images/icon_flapping.png differ
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ef2860c..a91a13e 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7912,7 +7912,35 @@ def mode_notifications(phase):
date = entry.get("SHORTDATETIME", "")
if not date:
date = time.strftime("%Y-%m-%d %H:%M:%S",
time.localtime(int(entry["MICROTIME"]) / 1000000.0))
- table.cell(_("Date"), date)
+ table.cell(_("Date/Time"), date, css="nobr")
+ nottype = entry.get("NOTIFICATIONTYPE")
+ table.cell(_("Type"), nottype)
+
+
+ if nottype in [ "PROBLEM", "RECOVERY" ]:
+ if entry.get("SERVICESTATE"):
+ statename = _(entry["SERVICESTATE"][:4])
+ state = entry["SERVICESTATEID"]
+ css = "state svcstate state%s" % state
+ else:
+ statename = _(entry.get("HOSTSTATE")[:4])
+ state = entry["HOSTSTATEID"]
+ css = "state hstate state%s" % state
+ table.cell(_("State"), statename, css=css)
+ elif nottype.startswith("DOWNTIME"):
+ table.cell(_("State"))
+ html.icon(_("Downtime"), "downtime")
+ elif nottype.startswith("ACK"):
+ table.cell(_("State"))
+ html.icon(_("Acknowledgement"), "ack")
+ elif nottype.startswith("FLAP"):
+ table.cell(_("State"))
+ html.icon(_("Flapping"), "flapping")
+ else:
+ table.cell(_("State"), "")
+
+
+
table.cell(_("Host"), entry.get("HOSTNAME",
""))
table.cell(_("Service"), entry.get("SERVICEDESC",
""))
output = entry.get("SERVICEOUTPUT",
entry.get("HOSTOUTPUT"))