Module: check_mk
Branch: master
Commit: 38976b2f617376da9a34953eb98c827ddec7f519
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=38976b2f617376…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jan 21 14:33:46 2014 +0100
Support multiline plugin output for Check_MK Checks
Check_MK checks can now return multiline ouput by just using the \n in it ouput.
---
.werks/124 | 8 ++++++++
ChangeLog | 3 ++-
modules/check_mk_base.py | 2 ++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/124 b/.werks/124
new file mode 100644
index 0000000..dea32bf
--- /dev/null
+++ b/.werks/124
@@ -0,0 +1,8 @@
+Title: Support multiline plugin output for Check_MK Checks
+Level: 2
+Component: core
+Version: 1.2.5i1
+Date: 1390310917
+Class: feature
+
+Check_MK checks can now return multiline ouput by just using the \n in it ouput.
diff --git a/ChangeLog b/ChangeLog
index 82a883e..ea44f79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Core & Setup:
* 0386 Added all active checks to check_mk -L output...
* 0452 Speedup generation of configuration...
+ * 0124 Support multiline plugin output for Check_MK Checks...
* 0087 FIX: Fixed possible locking issue when using datasource program with long
output...
* 0313 FIX: Avoid duplicate reading of configuration file on --create-rrd...
* 0379 FIX: check_mk -c: Now also rewrites the location of conf.d directory
@@ -155,8 +156,8 @@
* 0425 FIX: Fix login loop bug in distributed environments with different auth
secrets
* 0117 FIX: Availability button is now visible for users without the right to edit
views
* 0431 FIX: LDAP: Fixed group syncrhonisation when nested group sync is enabled
- * 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
* 0122 FIX: Multisite view editor not longer throwing a exception when loading views
from other users
+ * 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index c2522d0..ea3ea0f 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1284,6 +1284,8 @@ 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
+ output = output.replace('\n', '\\n')
if monitoring_core == "cmc":
result = "\t%d\t%s\t%s\n" % (state, service,
output.replace("\0", "")) # remove binary 0, CMC does not like it
if opt_keepalive: