From fe35791b1b0b00df05f94423e1704187b99bedab Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 24 Jun 2013 11:35:56 +0200 Subject: [PATCH] status.dat: Escape new-lines in multi-line plugin output Fixes #3671 --- components/compat/compatcomponent.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index 06f6d9309..3a2d2f509 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include using namespace icinga; @@ -343,8 +344,12 @@ void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Pt if (cr) { output = cr->Get("output"); + boost::algorithm::replace_all(output, "\n", "\\n"); + schedule_end = cr->Get("schedule_end"); + perfdata = cr->Get("performance_data_raw"); + boost::algorithm::replace_all(perfdata, "\n", "\\n"); } int state = service->GetState();