]> granicus.if.org Git - icinga2/commitdiff
DB IDO: Don't send empty columns in queries
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 21 Dec 2017 08:57:21 +0000 (09:57 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 15 Jan 2018 12:39:34 +0000 (13:39 +0100)
lib/db_ido/dbevents.cpp
lib/db_ido/hostdbobject.cpp
lib/db_ido/servicedbobject.cpp

index a0ec3e441f14223023c34906860d23374bef6c2b..9dc50a954a8c08cca88f6aff2db42512e5b6d993 100644 (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()));
index e5ba614f4cc53aea43080e382e77d06081ccd125..62fcefe0985cf3a8859a3e2189730715402c47a7 100644 (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());
index 5012465d9cbab643f707673a77a2e929d512d64d..e6f674d84cb7f015dab0f5f43faf7a96dd3e9a2d 100644 (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());