* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
+#include "icinga/compatutility.hpp"
#include "compat/checkresultreader.hpp"
#include "compat/checkresultreader.tcpp"
#include "icinga/service.hpp"
}
CheckResult::Ptr result = new CheckResult();
- std::pair<String, Value> co = PluginUtility::ParseCheckOutput(attrs["output"]);
+ String output = CompatUtility::UnEscapeString(attrs["output"]);
+ std::pair<String, Value> co = PluginUtility::ParseCheckOutput(output);
result->SetOutput(co.first);
result->SetPerformanceData(PluginUtility::SplitPerfdata(co.second));
result->SetState(PluginUtility::ExitStatusToState(Convert::ToLong(attrs["return_code"])));
return result;
}
+String CompatUtility::UnEscapeString(const String& str)
+{
+ String result = str;
+ boost::algorithm::replace_all(result, "\\n", "\n");
+ return result;
+}
+
std::pair<unsigned long, unsigned long> CompatUtility::ConvertTimestamp(double time)
{
unsigned long time_sec = static_cast<long>(time);
int exitStatus = Convert::ToDouble(arguments[2]);
CheckResult::Ptr result = new CheckResult();
- std::pair<String, String> co = PluginUtility::ParseCheckOutput(arguments[3]);
+ String output = CompatUtility::UnEscapeString(arguments[3]);
+ std::pair<String, String> co = PluginUtility::ParseCheckOutput(output);
result->SetOutput(co.first);
result->SetPerformanceData(PluginUtility::SplitPerfdata(co.second));
result->SetState(PluginUtility::ExitStatusToState(exitStatus));