Module: check_mk
Branch: master
Commit: 65d9a6d7225d79c25bf625caaf38c1d8627af1f9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=65d9a6d7225d79…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Nov 6 11:21:57 2010 +0100
debug_log: output more information
---
ChangeLog | 2 +-
modules/check_mk_base.py | 18 +++++++++++-------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9a6f04f..0d46dd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,7 +24,7 @@
* setup.sh: fix problem with missing package_info (only appears if setup
is called from another directory)
* ALL_SERVICES: Instead of [ "" ] you can now write ALL_SERVICES
-
+ * debug_log: also output Check_MK version, check item and check parameters
Checks & Agents:
* megaraid_pdisks: Using the real enclosure number as check item now
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index e6e719c..da72b8c 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -744,20 +744,24 @@ def do_all_checks_on_host(hostname, ipaddress):
print "Counter wrapped, not handled by check, ignoring this
check result: %s" % e
dont_submit = True
except Exception, e:
- result = (3, "UNKNOWN - invalid output from agent or error in check
%s. Please set <tt>debug_log</tt> to a filename in
<tt>main.mk</tt> for enabling exception logging." % checkname)
+ result = (3, "UNKNOWN - invalid output from agent, invalid check
parameters or error in implementation of check %s. Please set
<tt>debug_log</tt> to a filename in <tt>main.mk</tt> for enabling
exception logging." % checkname)
if debug_log:
try:
import traceback, pprint
l = file(debug_log, "a")
l.write(("Invalid output from plugin or error in
check:\n"
- " Date: %s\n"
- " Host: %s\n"
- " Service: %s\n"
- " Check type: %s\n"
+ " Check_MK Version: %s\n"
+ " Date: %s\n"
+ " Host: %s\n"
+ " Service: %s\n"
+ " Check type: %s\n"
+ " Item: %r\n"
+ " Parameters: %s\n"
" %s\n"
- " Agent info: %s\n\n") % (
+ " Agent info: %s\n\n") % (
+ check_mk_version,
time.strftime("%Y-%d-%m %H:%M:%S"),
- hostname, description, checkname,
+ hostname, description, checkname, item,
pprint.pformat(params),
traceback.format_exc().replace('\n', '\n
'),
pprint.pformat(info)))
except: