Module: check_mk
Branch: master
Commit: db7af8c95a11aac6f174e59fb99139553177c5c3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=db7af8c95a11aa…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 25 17:07:28 2012 +0200
mkeventd: show syslog facility/priority in rule list
---
mkeventd/web/plugins/wato/mkeventd.py | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/mkeventd/web/plugins/wato/mkeventd.py
b/mkeventd/web/plugins/wato/mkeventd.py
index 1ec46b2..d9529f0 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -780,6 +780,8 @@ def mode_mkeventd_rules(phase):
html.write("<th></th>")
html.write("<th>%s</th>" % _("ID"))
html.write("<th>%s</th>" % _("State"))
+ html.write("<th>%s</th>" % _("Priority"))
+ html.write("<th>%s</th>" % _("Facility"))
html.write("<th>%s</th>" % _("Service Level"))
if defaults.omd_root:
html.write("<th>%s</th>" % _("Hits"))
@@ -848,6 +850,26 @@ def mode_mkeventd_rules(phase):
else:
html.write('<td class="state state%d">%s</td>'
% (rule["state"],
{0:_("OK"), 1:_("WARN"), 2:_("CRIT"),
3:_("UNKNOWN"), -1:_("(syslog)")}[rule["state"]]))
+
+ # Syslog priority
+ if "match_priority" in rule:
+ prio_from, prio_to = rule["match_priority"]
+ if prio_from == prio_to:
+ prio_text = mkeventd.syslog_priorities[prio_from][1]
+ else:
+ prio_text = mkeventd.syslog_priorities[prio_from][1][:2] + ".."
+ \
+ mkeventd.syslog_priorities[prio_to][1][:2]
+ else:
+ prio_text = ""
+ html.write("<td>%s</td>" % prio_text)
+
+ # Syslog Facility
+ if "match_facility" in rule:
+ facnr = rule["match_facility"]
+ html.write("<td>%s</td>" %
mkeventd.syslog_facilities[facnr][1])
+ else:
+ html.write("<td></td>")
+
html.write('<td>%s</td>' %
dict(mkeventd.service_levels()).get(rule["sl"], rule["sl"]))
if defaults.omd_root:
hits = rule.get('hits')