mirror of https://github.com/Icinga/icinga2.git
Drop CompatUtility::*Command helpers
This commit is contained in:
parent
b4af0971af
commit
5466197d29
|
@ -172,8 +172,6 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
|
||||||
fields->Set("failure_prediction_enabled", Empty);
|
fields->Set("failure_prediction_enabled", Empty);
|
||||||
fields->Set("process_performance_data", host->GetEnablePerfdata());
|
fields->Set("process_performance_data", host->GetEnablePerfdata());
|
||||||
fields->Set("obsess_over_host", Empty);
|
fields->Set("obsess_over_host", Empty);
|
||||||
fields->Set("event_handler", CompatUtility::GetCheckableEventHandler(host));
|
|
||||||
fields->Set("check_command", CompatUtility::GetCheckableCheckCommand(host));
|
|
||||||
fields->Set("normal_check_interval", CompatUtility::GetCheckableCheckInterval(host));
|
fields->Set("normal_check_interval", CompatUtility::GetCheckableCheckInterval(host));
|
||||||
fields->Set("retry_check_interval", CompatUtility::GetCheckableRetryInterval(host));
|
fields->Set("retry_check_interval", CompatUtility::GetCheckableRetryInterval(host));
|
||||||
fields->Set("check_timeperiod_object_id", host->GetCheckPeriod());
|
fields->Set("check_timeperiod_object_id", host->GetCheckPeriod());
|
||||||
|
@ -181,6 +179,16 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
|
||||||
|
|
||||||
fields->Set("original_attributes", JsonEncode(host->GetOriginalAttributes()));
|
fields->Set("original_attributes", JsonEncode(host->GetOriginalAttributes()));
|
||||||
|
|
||||||
|
EventCommand::Ptr eventCommand = host->GetEventCommand();
|
||||||
|
|
||||||
|
if (eventCommand)
|
||||||
|
fields->Set("event_handler", eventCommand->GetName());
|
||||||
|
|
||||||
|
CheckCommand::Ptr checkCommand = host->GetCheckCommand();
|
||||||
|
|
||||||
|
if (checkCommand)
|
||||||
|
fields->Set("check_command", checkCommand->GetName());
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,8 +158,6 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
|
||||||
|
|
||||||
fields->Set("scheduled_downtime_depth", service->GetDowntimeDepth());
|
fields->Set("scheduled_downtime_depth", service->GetDowntimeDepth());
|
||||||
fields->Set("process_performance_data", service->GetEnablePerfdata());
|
fields->Set("process_performance_data", service->GetEnablePerfdata());
|
||||||
fields->Set("event_handler", CompatUtility::GetCheckableEventHandler(service));
|
|
||||||
fields->Set("check_command", CompatUtility::GetCheckableCheckCommand(service));
|
|
||||||
fields->Set("normal_check_interval", CompatUtility::GetCheckableCheckInterval(service));
|
fields->Set("normal_check_interval", CompatUtility::GetCheckableCheckInterval(service));
|
||||||
fields->Set("retry_check_interval", CompatUtility::GetCheckableRetryInterval(service));
|
fields->Set("retry_check_interval", CompatUtility::GetCheckableRetryInterval(service));
|
||||||
fields->Set("check_timeperiod_object_id", service->GetCheckPeriod());
|
fields->Set("check_timeperiod_object_id", service->GetCheckPeriod());
|
||||||
|
@ -167,6 +165,16 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
|
||||||
|
|
||||||
fields->Set("original_attributes", JsonEncode(service->GetOriginalAttributes()));
|
fields->Set("original_attributes", JsonEncode(service->GetOriginalAttributes()));
|
||||||
|
|
||||||
|
EventCommand::Ptr eventCommand = service->GetEventCommand();
|
||||||
|
|
||||||
|
if (eventCommand)
|
||||||
|
fields->Set("event_handler", eventCommand->GetName());
|
||||||
|
|
||||||
|
CheckCommand::Ptr checkCommand = service->GetCheckCommand();
|
||||||
|
|
||||||
|
if (checkCommand)
|
||||||
|
fields->Set("check_command", checkCommand->GetName());
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,28 +202,6 @@ String CompatUtility::GetCheckableCheckPeriod(const Checkable::Ptr& checkable)
|
||||||
return "24x7";
|
return "24x7";
|
||||||
}
|
}
|
||||||
|
|
||||||
String CompatUtility::GetCheckableEventHandler(const Checkable::Ptr& checkable)
|
|
||||||
{
|
|
||||||
String event_command_str;
|
|
||||||
EventCommand::Ptr eventcommand = checkable->GetEventCommand();
|
|
||||||
|
|
||||||
if (eventcommand)
|
|
||||||
event_command_str = eventcommand->GetName();
|
|
||||||
|
|
||||||
return event_command_str;
|
|
||||||
}
|
|
||||||
|
|
||||||
String CompatUtility::GetCheckableCheckCommand(const Checkable::Ptr& checkable)
|
|
||||||
{
|
|
||||||
String check_command_str;
|
|
||||||
CheckCommand::Ptr checkcommand = checkable->GetCheckCommand();
|
|
||||||
|
|
||||||
if (checkcommand)
|
|
||||||
check_command_str = checkcommand->GetName();
|
|
||||||
|
|
||||||
return check_command_str;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CompatUtility::GetCheckableIsVolatile(const Checkable::Ptr& checkable)
|
int CompatUtility::GetCheckableIsVolatile(const Checkable::Ptr& checkable)
|
||||||
{
|
{
|
||||||
return (checkable->GetVolatile() ? 1 : 0);
|
return (checkable->GetVolatile() ? 1 : 0);
|
||||||
|
|
|
@ -55,9 +55,6 @@ public:
|
||||||
static double GetCheckableRetryInterval(const Checkable::Ptr& checkable);
|
static double GetCheckableRetryInterval(const Checkable::Ptr& checkable);
|
||||||
static String GetCheckableCheckPeriod(const Checkable::Ptr& checkable);
|
static String GetCheckableCheckPeriod(const Checkable::Ptr& checkable);
|
||||||
|
|
||||||
static String GetCheckableEventHandler(const Checkable::Ptr& checkable);
|
|
||||||
static String GetCheckableCheckCommand(const Checkable::Ptr& checkable);
|
|
||||||
|
|
||||||
static int GetCheckableIsVolatile(const Checkable::Ptr& checkable);
|
static int GetCheckableIsVolatile(const Checkable::Ptr& checkable);
|
||||||
static double GetCheckableLowFlapThreshold(const Checkable::Ptr& checkable);
|
static double GetCheckableLowFlapThreshold(const Checkable::Ptr& checkable);
|
||||||
static double GetCheckableHighFlapThreshold(const Checkable::Ptr& checkable);
|
static double GetCheckableHighFlapThreshold(const Checkable::Ptr& checkable);
|
||||||
|
|
Loading…
Reference in New Issue