Drop CompatUtility::*Command helpers

This commit is contained in:
Michael Friedrich 2017-12-05 19:30:45 +01:00
parent b4af0971af
commit 5466197d29
4 changed files with 20 additions and 29 deletions

View File

@ -172,8 +172,6 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
fields->Set("failure_prediction_enabled", Empty);
fields->Set("process_performance_data", host->GetEnablePerfdata());
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("retry_check_interval", CompatUtility::GetCheckableRetryInterval(host));
fields->Set("check_timeperiod_object_id", host->GetCheckPeriod());
@ -181,6 +179,16 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
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;
}

View File

@ -158,8 +158,6 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
fields->Set("scheduled_downtime_depth", service->GetDowntimeDepth());
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("retry_check_interval", CompatUtility::GetCheckableRetryInterval(service));
fields->Set("check_timeperiod_object_id", service->GetCheckPeriod());
@ -167,6 +165,16 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
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;
}

View File

@ -202,28 +202,6 @@ String CompatUtility::GetCheckableCheckPeriod(const Checkable::Ptr& checkable)
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)
{
return (checkable->GetVolatile() ? 1 : 0);

View File

@ -55,9 +55,6 @@ public:
static double GetCheckableRetryInterval(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 double GetCheckableLowFlapThreshold(const Checkable::Ptr& checkable);
static double GetCheckableHighFlapThreshold(const Checkable::Ptr& checkable);