Module: check_mk
Branch: master
Commit: a9632b9d2d216d9775020a48e1603c2b0953a1d9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a9632b9d2d216d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 3 16:32:16 2015 +0200
Added some more details to check crash reports
---
modules/check_mk_base.py | 10 ++++++++++
web/htdocs/crash_reporting.py | 32 +++++++++++++++++++++++++++-----
2 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 2a89ca7..8ffcfb6 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1507,6 +1507,13 @@ def prepare_crash_dump_directory(crash_dir):
pass
+def is_manual_check(hostname, check_type, item):
+ manual_checks = get_check_table(hostname, remove_duplicates=True,
+ world=opt_keepalive and "active" or
"config",
+ skip_autochecks=True)
+ return (check_type, item) in manual_checks
+
+
def create_crash_dump_info_file(crash_dir, hostname, check_type, item, params,
description, info, text):
exc_type, exc_value, exc_traceback = sys.exc_info()
@@ -1521,11 +1528,14 @@ def create_crash_dump_info_file(crash_dir, hostname, check_type,
item, params, d
"details" : {
"check_output" : text,
"host" : hostname,
+ "is_cluster" : is_cluster(hostname),
"description" : description,
"check_type" : check_type,
"item" : item,
"params" : params,
"uses_snmp" : check_uses_snmp(check_type),
+ "inline_snmp" : has_inline_snmp and use_inline_snmp,
+ "manual_check" : is_manual_check(hostname, check_type, item),
},
}
diff --git a/web/htdocs/crash_reporting.py b/web/htdocs/crash_reporting.py
index 01048fa..a373a02 100644
--- a/web/htdocs/crash_reporting.py
+++ b/web/htdocs/crash_reporting.py
@@ -279,20 +279,42 @@ def show_crash_report(info):
def show_crashed_check_details(info):
+ def format_bool(val):
+ return {
+ True : _("Yes"),
+ False : _("No"),
+ None : _("Unknown"),
+ }[val]
+
details = info["details"]
html.write("<h2>%s</h2>" % _("Details"))
html.write("<table class=\"data\">")
+
html.write("<tr class=\"data even0\"><td class=\"left
legend\">%s</td>" % _("Host"))
html.write("<td>%s</td></tr>" %
html.attrencode(details["host"]))
- html.write("<tr class=\"data odd0\"><td
class=\"left\">%s</td>" % _("Check Type"))
+
+ html.write("<tr class=\"data odd0\"><td
class=\"left\">%s</td>" % _("Is Cluster Host"))
+ html.write("<td>%s</td></tr>" %
format_bool(details.get("is_cluster")))
+
+ html.write("<tr class=\"data even0\"><td
class=\"left\">%s</td>" % _("Check Type"))
html.write("<td>%s</td></tr>" %
html.attrencode(details["check_type"]))
+
+ html.write("<tr class=\"data odd0\"><td
class=\"left\">%s</td>" % _("Manual Check"))
+ html.write("<td><pre>%s</pre></td></tr>" %
format_bool(details.get("manual_check")))
+
html.write("<tr class=\"data even0\"><td
class=\"left\">%s</td>" % _("Uses SNMP"))
- html.write("<td><pre>%s</pre></td></tr>" %
(details.get("uses_snmp", False) and _("Yes") or _("No")))
- html.write("<tr class=\"data odd0\"><td
class=\"left\">%s</td>" % _("Check Item"))
+ html.write("<td><pre>%s</pre></td></tr>" %
format_bool(details.get("uses_snmp")))
+
+ html.write("<tr class=\"data odd0\"><td
class=\"left\">%s</td>" % _("Inline-SNMP"))
+ html.write("<td><pre>%s</pre></td></tr>" %
format_bool(details.get("inline_snmp")))
+
+ html.write("<tr class=\"data even0\"><td
class=\"left\">%s</td>" % _("Check Item"))
html.write("<td>%s</td></tr>" %
html.attrencode(details["item"]))
- html.write("<tr class=\"data even0\"><td
class=\"left\">%s</td>" % _("Description"))
+
+ html.write("<tr class=\"data odd0\"><td
class=\"left\">%s</td>" % _("Description"))
html.write("<td>%s</td></tr>" %
html.attrencode(details["description"]))
- html.write("<tr class=\"data odd0\"><td
class=\"left\">%s</td>" % _("Parameters"))
+
+ html.write("<tr class=\"data even0\"><td
class=\"left\">%s</td>" % _("Parameters"))
html.write("<td><pre>%s</pre></td></tr>" %
html.attrencode(format_params(details["params"])))
html.write("</table>")