DB IDO: Don't send empty columns in queries

This commit is contained in:
Michael Friedrich 2017-12-21 09:57:21 +01:00
parent e5462ea3d1
commit d672df3f2c
3 changed files with 0 additions and 29 deletions

View File

@ -1405,7 +1405,6 @@ void DbEvents::AddCheckableCheckHistory(const Checkable::Ptr& checkable, const C
fields1->Set("end_time", DbValue::FromTimestamp(time_bag_end.first));
fields1->Set("end_time_usec", time_bag_end.second);
fields1->Set("command_object_id", checkable->GetCheckCommand());
fields1->Set("command_args", Empty);
fields1->Set("command_line", CompatUtility::GetCommandLine(checkable->GetCheckCommand()));
fields1->Set("execution_time", Convert::ToString(execution_time));
fields1->Set("latency", Convert::ToString(cr->CalculateLatency()));

View File

@ -63,16 +63,11 @@ Dictionary::Ptr HostDbObject::GetConfigFields() const
fields->Set("check_command_object_id", host->GetCheckCommand());
fields->Set("eventhandler_command_object_id", host->GetEventCommand());
fields->Set("eventhandler_command_args", Empty);
fields->Set("notification_timeperiod_object_id", Empty);
fields->Set("check_timeperiod_object_id", host->GetCheckPeriod());
fields->Set("failure_prediction_options", Empty);
fields->Set("check_interval", (host->GetCheckInterval() / 60.0));
fields->Set("retry_interval", (host->GetRetryInterval() / 60.0));
fields->Set("max_check_attempts", host->GetMaxCheckAttempts());
fields->Set("first_notification_delay", Empty);
fields->Set("notification_interval", CompatUtility::GetCheckableNotificationNotificationInterval(host));
unsigned long notificationStateFilter = CompatUtility::GetCheckableNotificationTypeFilter(host);
@ -86,14 +81,7 @@ Dictionary::Ptr HostDbObject::GetConfigFields() const
fields->Set("notify_on_downtime", (notificationTypeFilter & NotificationDowntimeStart) ||
(notificationTypeFilter & NotificationDowntimeEnd) || (notificationTypeFilter & NotificationDowntimeRemoved));
fields->Set("stalk_on_up", Empty);
fields->Set("stalk_on_down", Empty);
fields->Set("stalk_on_unreachable", Empty);
fields->Set("flap_detection_enabled", host->GetEnableFlapping());
fields->Set("flap_detection_on_up", Empty);
fields->Set("flap_detection_on_down", Empty);
fields->Set("flap_detection_on_unreachable", Empty);
fields->Set("low_flap_threshold", host->GetFlappingThresholdLow());
fields->Set("high_flap_threshold", host->GetFlappingThresholdLow());
@ -161,7 +149,6 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
fields->Set("state_type", host->GetStateType());
fields->Set("last_notification", DbValue::FromTimestamp(CompatUtility::GetCheckableNotificationLastNotification(host)));
fields->Set("next_notification", DbValue::FromTimestamp(CompatUtility::GetCheckableNotificationNextNotification(host)));
fields->Set("no_more_notifications", Empty);
fields->Set("notifications_enabled", host->GetEnableNotifications());
fields->Set("problem_has_been_acknowledged", host->GetAcknowledgement() != AcknowledgementNone);
fields->Set("acknowledgement_type", host->GetAcknowledgement());
@ -179,9 +166,7 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
}
fields->Set("scheduled_downtime_depth", host->GetDowntimeDepth());
fields->Set("failure_prediction_enabled", Empty);
fields->Set("process_performance_data", host->GetEnablePerfdata());
fields->Set("obsess_over_host", Empty);
fields->Set("normal_check_interval", (host->GetCheckInterval() / 60.0));
fields->Set("retry_check_interval", (host->GetRetryInterval() / 60.0));
fields->Set("check_timeperiod_object_id", host->GetCheckPeriod());

View File

@ -58,14 +58,10 @@ Dictionary::Ptr ServiceDbObject::GetConfigFields() const
fields->Set("display_name", service->GetDisplayName());
fields->Set("check_command_object_id", service->GetCheckCommand());
fields->Set("eventhandler_command_object_id", service->GetEventCommand());
fields->Set("eventhandler_command_args", Empty);
fields->Set("notification_timeperiod_object_id", Empty);
fields->Set("check_timeperiod_object_id", service->GetCheckPeriod());
fields->Set("failure_prediction_options", Empty);
fields->Set("check_interval", (service->GetCheckInterval() / 60.0));
fields->Set("retry_interval", (service->GetRetryInterval() / 60.0));
fields->Set("max_check_attempts", service->GetMaxCheckAttempts());
fields->Set("first_notification_delay", Empty);
fields->Set("notification_interval", CompatUtility::GetCheckableNotificationNotificationInterval(service));
unsigned long notificationStateFilter = CompatUtility::GetCheckableNotificationTypeFilter(service);
@ -86,10 +82,6 @@ Dictionary::Ptr ServiceDbObject::GetConfigFields() const
fields->Set("stalk_on_critical", 0);
fields->Set("is_volatile", service->GetVolatile());
fields->Set("flap_detection_enabled", service->GetEnableFlapping());
fields->Set("flap_detection_on_ok", Empty);
fields->Set("flap_detection_on_warning", Empty);
fields->Set("flap_detection_on_unknown", Empty);
fields->Set("flap_detection_on_critical", Empty);
fields->Set("low_flap_threshold", service->GetFlappingThresholdLow());
fields->Set("high_flap_threshold", service->GetFlappingThresholdLow());
fields->Set("process_performance_data", service->GetEnablePerfdata());
@ -98,11 +90,7 @@ Dictionary::Ptr ServiceDbObject::GetConfigFields() const
fields->Set("event_handler_enabled", service->GetEnableEventHandler());
fields->Set("passive_checks_enabled", service->GetEnablePassiveChecks());
fields->Set("active_checks_enabled", service->GetEnableActiveChecks());
fields->Set("retain_status_information", Empty);
fields->Set("retain_nonstatus_information", Empty);
fields->Set("notifications_enabled", service->GetEnableNotifications());
fields->Set("obsess_over_service", Empty);
fields->Set("failure_prediction_enabled", Empty);
fields->Set("notes", service->GetNotes());
fields->Set("notes_url", service->GetNotesUrl());
fields->Set("action_url", service->GetActionUrl());
@ -146,7 +134,6 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
fields->Set("state_type", service->GetStateType());
fields->Set("last_notification", DbValue::FromTimestamp(CompatUtility::GetCheckableNotificationLastNotification(service)));
fields->Set("next_notification", DbValue::FromTimestamp(CompatUtility::GetCheckableNotificationNextNotification(service)));
fields->Set("no_more_notifications", Empty);
fields->Set("notifications_enabled", service->GetEnableNotifications());
fields->Set("problem_has_been_acknowledged", service->GetAcknowledgement() != AcknowledgementNone);
fields->Set("acknowledgement_type", service->GetAcknowledgement());