Module: check_mk
Branch: master
Commit: c32ebb7b5f1b18d7259bf06872e5a5c3ed371877
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c32ebb7b5f1b18…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 2 10:30:32 2015 +0100
#2081 FIX Improved logging of mkeventd in error cases
---
.werks/2081 | 10 ++++++++++
ChangeLog | 1 +
doc/treasures/mknotifyd | 6 ++++--
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/2081 b/.werks/2081
new file mode 100644
index 0000000..6b2354f
--- /dev/null
+++ b/.werks/2081
@@ -0,0 +1,10 @@
+Title: Improved logging of mkeventd in error cases
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1425288608
+
+
diff --git a/ChangeLog b/ChangeLog
index 8229f32..54fd205 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -311,6 +311,7 @@
* 1988 FIX: Gracefully handle invalid empty bulk notification files from previous
buggy versions
* 2015 FIX: Fixed sending notifications for services with umlauts in names...
* 2038 FIX: Log complete Email address into monitoring history when notifying
explicity addresses
+ * 2081 FIX: Improved logging of mkeventd in error cases
BI:
* 1784 FIX: Fix exception in BI Boxes when parents are being used
diff --git a/doc/treasures/mknotifyd b/doc/treasures/mknotifyd
index e9519a4..f4e7c0f 100755
--- a/doc/treasures/mknotifyd
+++ b/doc/treasures/mknotifyd
@@ -136,6 +136,7 @@ class SpoolfilesHandler:
if file_age < files_older_than:
continue
+ verbose("Processing spoolfile: %s" % spoolfile_path)
try:
content = eval(file(spoolfile_path).read())
if not content.get("context"):
@@ -152,7 +153,7 @@ class SpoolfilesHandler:
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(10)
- host, port =
content.get("forward").split(':',1)
+ host, port = content["forward"].split(':',1)
del content["forward"]
verbose("Forward notification to %s %s" % (host, port),
2)
sock.connect((host, int(port)))
@@ -173,6 +174,7 @@ class SpoolfilesHandler:
break # Error while reading
except Exception, e:
# Connection problems
+ log("Failed to forward notification %s to %s:%s: %s" %
(spoolfile_path, host, port, e))
verbose(format_exception(), 2)
spoolfile_process_result = response_text != "OK" and 1 or
0
@@ -395,7 +397,7 @@ def cmp_config_paths(a, b):
def usage():
sys.stdout.write("""Usage: mknotifyd [OPTIONS]
- -v, --verbose Enable verbose output
+ -v, --verbose Enable verbose output, twice for more details
-g, --foreground Do not daemonize, run in foreground
-s, --single Single shot, exit after one cycle