diff --git a/lib/db_ido/hostdbobject.cpp b/lib/db_ido/hostdbobject.cpp index 9136ed58a..0063a3d95 100644 --- a/lib/db_ido/hostdbobject.cpp +++ b/lib/db_ido/hostdbobject.cpp @@ -63,8 +63,8 @@ Dictionary::Ptr HostDbObject::GetConfigFields() const fields->Set("check_command_object_id", host->GetCheckCommand()); fields->Set("eventhandler_command_object_id", host->GetEventCommand()); fields->Set("check_timeperiod_object_id", host->GetCheckPeriod()); - fields->Set("check_interval", (host->GetCheckInterval() / 60.0)); - fields->Set("retry_interval", (host->GetRetryInterval() / 60.0)); + 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("flap_detection_enabled", host->GetEnableFlapping()); fields->Set("low_flap_threshold", host->GetFlappingThresholdLow()); @@ -145,8 +145,8 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const fields->Set("percent_state_change", host->GetFlappingCurrent()); fields->Set("scheduled_downtime_depth", host->GetDowntimeDepth()); fields->Set("process_performance_data", host->GetEnablePerfdata()); - fields->Set("normal_check_interval", (host->GetCheckInterval() / 60.0)); - fields->Set("retry_check_interval", (host->GetRetryInterval() / 60.0)); + 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()); fields->Set("is_reachable", host->IsReachable()); fields->Set("original_attributes", JsonEncode(host->GetOriginalAttributes())); @@ -267,7 +267,7 @@ void HostDbObject::OnConfigUpdateHeavy() continue; } - int state_filter = dep->GetStateFilter(); + int stateFilter = dep->GetStateFilter(); Log(LogDebug, "HostDbObject") << "parent host: " << parent->GetName(); @@ -277,8 +277,8 @@ void HostDbObject::OnConfigUpdateHeavy() fields2->Set("dependent_host_object_id", host); fields2->Set("inherits_parent", 1); fields2->Set("timeperiod_object_id", dep->GetPeriod()); - fields2->Set("fail_on_up", (state_filter & StateFilterUp) ? 1 : 0); - fields2->Set("fail_on_down", (state_filter & StateFilterDown) ? 1 : 0); + fields2->Set("fail_on_up", stateFilter & StateFilterUp); + fields2->Set("fail_on_down", stateFilter & StateFilterDown); fields2->Set("instance_id", 0); /* DbConnection class fills in real ID */ DbQuery query2; diff --git a/lib/db_ido/servicedbobject.cpp b/lib/db_ido/servicedbobject.cpp index b48cbf757..93a80d199 100644 --- a/lib/db_ido/servicedbobject.cpp +++ b/lib/db_ido/servicedbobject.cpp @@ -59,8 +59,8 @@ Dictionary::Ptr ServiceDbObject::GetConfigFields() const fields->Set("check_command_object_id", service->GetCheckCommand()); fields->Set("eventhandler_command_object_id", service->GetEventCommand()); fields->Set("check_timeperiod_object_id", service->GetCheckPeriod()); - fields->Set("check_interval", (service->GetCheckInterval() / 60.0)); - fields->Set("retry_interval", (service->GetRetryInterval() / 60.0)); + 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("is_volatile", service->GetVolatile()); fields->Set("flap_detection_enabled", service->GetEnableFlapping()); @@ -138,8 +138,8 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const fields->Set("percent_state_change", service->GetFlappingCurrent()); fields->Set("scheduled_downtime_depth", service->GetDowntimeDepth()); fields->Set("process_performance_data", service->GetEnablePerfdata()); - fields->Set("normal_check_interval", (service->GetCheckInterval() / 60.0)); - fields->Set("retry_check_interval", (service->GetRetryInterval() / 60.0)); + fields->Set("normal_check_interval", service->GetCheckInterval() / 60.0); + fields->Set("retry_check_interval", service->GetRetryInterval() / 60.0); fields->Set("check_timeperiod_object_id", service->GetCheckPeriod()); fields->Set("is_reachable", service->IsReachable()); fields->Set("original_attributes", JsonEncode(service->GetOriginalAttributes())); @@ -227,7 +227,7 @@ void ServiceDbObject::OnConfigUpdateHeavy() Log(LogDebug, "ServiceDbObject") << "service parents: " << parent->GetName(); - int state_filter = dep->GetStateFilter(); + int stateFilter = dep->GetStateFilter(); /* service dependencies */ Dictionary::Ptr fields1 = new Dictionary(); @@ -235,10 +235,10 @@ void ServiceDbObject::OnConfigUpdateHeavy() fields1->Set("dependent_service_object_id", service); fields1->Set("inherits_parent", 1); fields1->Set("timeperiod_object_id", dep->GetPeriod()); - fields1->Set("fail_on_ok", (state_filter & StateFilterOK) ? 1 : 0); - fields1->Set("fail_on_warning", (state_filter & StateFilterWarning) ? 1 : 0); - fields1->Set("fail_on_critical", (state_filter & StateFilterCritical) ? 1 : 0); - fields1->Set("fail_on_unknown", (state_filter & StateFilterUnknown) ? 1 : 0); + fields1->Set("fail_on_ok", stateFilter & StateFilterOK); + fields1->Set("fail_on_warning", stateFilter & StateFilterWarning); + fields1->Set("fail_on_critical", stateFilter & StateFilterCritical); + fields1->Set("fail_on_unknown", stateFilter & StateFilterUnknown); fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */ DbQuery query1;