mirror of https://github.com/Icinga/icinga2.git
Drop CompatUtility::GetCheckResultPerfdata()
This commit is contained in:
parent
906c1accaa
commit
87b99c17b5
|
@ -28,6 +28,7 @@
|
|||
#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"
|
||||
|
@ -366,13 +367,12 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl
|
|||
}
|
||||
|
||||
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"
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#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>
|
||||
|
||||
|
@ -1411,7 +1412,7 @@ void DbEvents::AddCheckableCheckHistory(const Checkable::Ptr& checkable, const C
|
|||
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 */
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#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"
|
||||
|
@ -127,7 +128,7 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
|
|||
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());
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#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"
|
||||
|
@ -114,7 +115,7 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
|
|||
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());
|
||||
}
|
||||
|
||||
|
|
|
@ -485,14 +485,6 @@ String CompatUtility::GetCheckResultLongOutput(const CheckResult::Ptr& cr)
|
|||
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;
|
||||
|
|
|
@ -81,7 +81,6 @@ public:
|
|||
/* 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);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#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"
|
||||
|
@ -407,10 +408,10 @@ Value HostsTable::PerfDataAccessor(const Value& row)
|
|||
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)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#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"
|
||||
|
@ -342,10 +343,10 @@ Value ServicesTable::PerfDataAccessor(const Value& row)
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue