#include "icinga/timeperiod.hpp"
#include "icinga/notificationcommand.hpp"
#include "icinga/compatutility.hpp"
+#include "icinga/pluginutility.hpp"
#include "icinga/dependency.hpp"
#include "base/configtype.hpp"
#include "base/objectlock.hpp"
}
fp << "\t" "state_type=" << checkable->GetStateType() << "\n"
- "\t" "plugin_output=" << CompatUtility::GetCheckResultOutput(cr) << "\n"
- "\t" "long_plugin_output=" << CompatUtility::GetCheckResultLongOutput(cr) << "\n"
- "\t" "performance_data=" << CompatUtility::GetCheckResultPerfdata(cr) << "\n";
+ "\t" "last_check=" << static_cast<long>(host->GetLastCheck()) << "\n";
if (cr) {
- fp << "\t" << "check_source=" << cr->GetCheckSource() << "\n"
- "\t" "last_check=" << static_cast<long>(cr->GetScheduleEnd()) << "\n";
+ fp << "\t" "plugin_output=" << CompatUtility::GetCheckResultOutput(cr) << "\n"
+ "\t" "long_plugin_output=" << CompatUtility::GetCheckResultLongOutput(cr) << "\n"
+ "\t" "performance_data=" << PluginUtility::FormatPerfdata(cr->GetPerformanceData()) << "\n"
}
fp << "\t" << "next_check=" << static_cast<long>(checkable->GetNextCheck()) << "\n"
#include "icinga/eventcommand.hpp"
#include "icinga/externalcommandprocessor.hpp"
#include "icinga/compatutility.hpp"
+#include "icinga/pluginutility.hpp"
#include "icinga/icingaapplication.hpp"
#include <boost/algorithm/string/join.hpp>
fields1->Set("return_code", cr->GetExitStatus());
fields1->Set("output", CompatUtility::GetCheckResultOutput(cr));
fields1->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
- fields1->Set("perfdata", CompatUtility::GetCheckResultPerfdata(cr));
+ fields1->Set("perfdata", PluginUtility::FormatPerfdata(cr->GetPerformanceData()));
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
#include "icinga/checkcommand.hpp"
#include "icinga/eventcommand.hpp"
#include "icinga/compatutility.hpp"
+#include "icinga/pluginutility.hpp"
#include "base/convert.hpp"
#include "base/objectlock.hpp"
#include "base/logger.hpp"
if (cr) {
fields->Set("output", CompatUtility::GetCheckResultOutput(cr));
fields->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
- fields->Set("perfdata", CompatUtility::GetCheckResultPerfdata(cr));
+ fields->Set("perfdata", PluginUtility::FormatPerfdata(cr->GetPerformanceData()));
fields->Set("check_source", cr->GetCheckSource());
}
#include "icinga/eventcommand.hpp"
#include "icinga/externalcommandprocessor.hpp"
#include "icinga/compatutility.hpp"
+#include "icinga/pluginutility.hpp"
#include "icinga/icingaapplication.hpp"
#include "remote/endpoint.hpp"
#include "base/convert.hpp"
if (cr) {
fields->Set("output", CompatUtility::GetCheckResultOutput(cr));
fields->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
- fields->Set("perfdata", CompatUtility::GetCheckResultPerfdata(cr));
+ fields->Set("perfdata", PluginUtility::FormatPerfdata(cr->GetPerformanceData()));
fields->Set("check_source", cr->GetCheckSource());
}
return Empty;
}
-String CompatUtility::GetCheckResultPerfdata(const CheckResult::Ptr& cr)
-{
- if (!cr)
- return String();
-
- return PluginUtility::FormatPerfdata(cr->GetPerformanceData());
-}
-
String CompatUtility::EscapeString(const String& str)
{
String result = str;
/* check result */
static String GetCheckResultOutput(const CheckResult::Ptr& cr);
static String GetCheckResultLongOutput(const CheckResult::Ptr& cr);
- static String GetCheckResultPerfdata(const CheckResult::Ptr& cr);
/* misc */
static String EscapeString(const String& str);
#include "icinga/macroprocessor.hpp"
#include "icinga/icingaapplication.hpp"
#include "icinga/compatutility.hpp"
+#include "icinga/pluginutility.hpp"
#include "base/configtype.hpp"
#include "base/objectlock.hpp"
#include "base/json.hpp"
String perfdata;
CheckResult::Ptr cr = host->GetLastCheckResult();
- if (cr)
- perfdata = CompatUtility::GetCheckResultPerfdata(cr);
+ if (!cr)
+ return Empty;
- return perfdata;
+ return PluginUtility::FormatPerfdata(cr->GetPerformanceData());
}
Value HostsTable::IconImageAccessor(const Value& row)
#include "icinga/macroprocessor.hpp"
#include "icinga/icingaapplication.hpp"
#include "icinga/compatutility.hpp"
+#include "icinga/pluginutility.hpp"
#include "base/configtype.hpp"
#include "base/objectlock.hpp"
#include "base/json.hpp"
String perfdata;
CheckResult::Ptr cr = service->GetLastCheckResult();
- if (cr)
- perfdata = CompatUtility::GetCheckResultPerfdata(cr);
+ if (!cr)
+ return Empty;
- return perfdata;
+ return PluginUtility::FormatPerfdata(cr->GetPerformanceData());
}
Value ServicesTable::CheckPeriodAccessor(const Value& row)