Module: check_mk
Branch: master
Commit: c0b7b2f1983cc318a3d4e5493550cd522c28e7d2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c0b7b2f1983cc3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 23 16:58:50 2014 +0100
Picked werk from 1.2.4
---
modules/check_mk_base.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 7e18d66..2e8390e 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1285,18 +1285,14 @@ def submit_check_result(host, servicedesc, result, sa):
def submit_to_core(host, service, state, output):
# Save data for sending it to the Check_MK Micro Core
# Replace \n to enable multiline ouput
- if monitoring_core == "cmc":
+ if opt_keepalive:
output = output.replace("\n", "\x01",
1).replace("\n","\\n")
result = "\t%d\t%s\t%s\n" % (state, service,
output.replace("\0", "")) # remove binary 0, CMC does not like it
- if opt_keepalive:
- global total_check_output
- total_check_output += result
- else:
- if not opt_verbose:
- sys.stdout.write(result)
+ global total_check_output
+ total_check_output += result
# Send to Nagios/Icinga command pipe
- elif check_submission == "pipe":
+ elif check_submission == "pipe" or monitoring_core == "cmc": #
CMC does not support file
output = output.replace("\n", "\\n")
open_command_pipe()
if nagios_command_pipe: