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());
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;
}
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());
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 "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);
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);