Skip to content

Commit

Permalink
refactor(engine): remove deprecated auto rescheduling options and cle…
Browse files Browse the repository at this point in the history
…an up event handling
  • Loading branch information
sechkem committed Mar 7, 2025
1 parent 3839a97 commit 5a961fe
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 77 deletions.
143 changes: 70 additions & 73 deletions common/engine_conf/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -134,79 +134,76 @@ message State {
string status_file = 73;
string poller_name = 74;
uint32 poller_id = 75;
bool auto_reschedule_checks = 76;
uint32 auto_rescheduling_interval = 77;
uint32 auto_rescheduling_window = 78;
uint32 cached_service_check_horizon = 79;
bool check_orphaned_hosts = 80;
bool check_orphaned_services = 81;
int32 command_check_interval = 82;
bool command_check_interval_is_seconds = 83;
bool enable_environment_macros = 84;
uint32 event_broker_options = 85;
uint32 event_handler_timeout = 86;
int32 external_command_buffer_slots = 87;
float high_host_flap_threshold = 88;
float high_service_flap_threshold = 89;
int32 host_check_timeout = 90;
uint32 host_freshness_check_interval = 91;
uint32 service_freshness_check_interval = 92;
bool log_event_handlers = 93;
bool log_external_commands = 94;
bool log_notifications = 95;
bool log_passive_checks = 96;
bool log_host_retries = 97;
bool log_service_retries = 98;
uint32 max_log_file_size = 99;
float low_host_flap_threshold = 100;
float low_service_flap_threshold = 101;
uint32 max_parallel_service_checks = 102;
uint32 ochp_timeout = 103;
uint32 ocsp_timeout = 104;
int32 perfdata_timeout = 105;
uint32 retained_host_attribute_mask = 106;
uint32 retained_process_host_attribute_mask = 107;
uint32 retained_contact_host_attribute_mask = 108;
uint32 retained_contact_service_attribute_mask = 109;
bool retain_state_information = 110;
uint32 retention_scheduling_horizon = 111;
uint32 retention_update_interval = 112;
uint32 service_check_timeout = 113;
float sleep_time = 114;
uint32 status_update_interval = 115;
uint32 time_change_threshold = 116;
bool use_regexp_matches = 117;
bool use_retained_program_state = 118;
bool use_retained_scheduling_info = 119;
bool use_setpgid = 120;
bool use_true_regexp_matching = 121;
DateType date_format = 122;
InterCheckDelay host_inter_check_delay_method = 123;
InterCheckDelay service_inter_check_delay_method = 124;
InterleaveFactor service_interleave_factor_method = 125;
bool enable_predictive_host_dependency_checks = 126;
bool enable_predictive_service_dependency_checks = 127;
bool send_recovery_notifications_anyways = 128;
bool host_down_disable_service_checks = 129;

repeated Command commands = 130;
repeated Connector connectors = 131;
repeated Contact contacts = 132;
repeated Contactgroup contactgroups = 133;
repeated Hostdependency hostdependencies = 134;
repeated Hostescalation hostescalations = 135;
repeated Hostgroup hostgroups = 136;
repeated Host hosts = 137;
repeated Servicedependency servicedependencies = 138;
repeated Serviceescalation serviceescalations = 139;
repeated Servicegroup servicegroups = 140;
repeated Service services = 141;
repeated Anomalydetection anomalydetections = 142;
repeated Timeperiod timeperiods = 143;
repeated Severity severities = 144;
repeated Tag tags = 145;
map<string, string> user = 146;
uint32 max_file_descriptors = 147;
uint32 cached_service_check_horizon = 76;
bool check_orphaned_hosts = 77;
bool check_orphaned_services = 78;
int32 command_check_interval = 79;
bool command_check_interval_is_seconds = 80;
bool enable_environment_macros = 81;
uint32 event_broker_options = 82;
uint32 event_handler_timeout = 83;
int32 external_command_buffer_slots = 84;
float high_host_flap_threshold = 85;
float high_service_flap_threshold = 86;
int32 host_check_timeout = 87;
uint32 host_freshness_check_interval = 88;
uint32 service_freshness_check_interval = 89;
bool log_event_handlers = 90;
bool log_external_commands = 91;
bool log_notifications = 92;
bool log_passive_checks = 93;
bool log_host_retries = 94;
bool log_service_retries = 95;
uint32 max_log_file_size = 96;
float low_host_flap_threshold = 97;
float low_service_flap_threshold = 98;
uint32 max_parallel_service_checks = 99;
uint32 ochp_timeout = 100;
uint32 ocsp_timeout = 101;
int32 perfdata_timeout = 102;
uint32 retained_host_attribute_mask = 103;
uint32 retained_process_host_attribute_mask = 104;
uint32 retained_contact_host_attribute_mask = 105;
uint32 retained_contact_service_attribute_mask = 106;
bool retain_state_information = 107;
uint32 retention_scheduling_horizon = 108;
uint32 retention_update_interval = 109;
uint32 service_check_timeout = 110;
float sleep_time = 111;
uint32 status_update_interval = 112;
uint32 time_change_threshold = 113;
bool use_regexp_matches = 114;
bool use_retained_program_state = 115;
bool use_retained_scheduling_info = 116;
bool use_setpgid = 117;
bool use_true_regexp_matching = 118;
DateType date_format = 119;
InterCheckDelay host_inter_check_delay_method = 120;
InterCheckDelay service_inter_check_delay_method = 121;
InterleaveFactor service_interleave_factor_method = 122;
bool enable_predictive_host_dependency_checks = 123;
bool enable_predictive_service_dependency_checks = 124;
bool send_recovery_notifications_anyways = 125;
bool host_down_disable_service_checks = 126;

repeated Command commands = 127;
repeated Connector connectors = 128;
repeated Contact contacts = 129;
repeated Contactgroup contactgroups = 130;
repeated Hostdependency hostdependencies = 131;
repeated Hostescalation hostescalations = 132;
repeated Hostgroup hostgroups = 133;
repeated Host hosts = 134;
repeated Servicedependency servicedependencies = 135;
repeated Serviceescalation serviceescalations = 136;
repeated Servicegroup servicegroups = 137;
repeated Service services = 138;
repeated Anomalydetection anomalydetections = 139;
repeated Timeperiod timeperiods = 140;
repeated Severity severities = 141;
repeated Tag tags = 142;
map<string, string> user = 143;
uint32 max_file_descriptors = 144;
}

message Value {
Expand Down
4 changes: 1 addition & 3 deletions engine/inc/com/centreon/engine/events/timed_event.hh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class timed_event {
void _exec_event_expire_downtime();
void _exec_event_host_check();
void _exec_event_hfreshness_check();
void _exec_event_reschedule_checks();
void _exec_event_expire_comment();
void _exec_event_expire_host_ack();
void _exec_event_expire_service_ack();
Expand Down Expand Up @@ -80,7 +79,6 @@ class timed_event {
// downtime
EVENT_HOST_CHECK, // active host check
EVENT_HFRESHNESS_CHECK, // checks host result "freshness"
EVENT_RESCHEDULE_CHECKS, // adjust scheduling of host and service checks
EVENT_EXPIRE_COMMENT, // removes expired comments
EVENT_EXPIRE_HOST_ACK, // remove expired host acknowledgement
EVENT_EXPIRE_SERVICE_ACK, // remove expired service acknowledgement
Expand All @@ -104,7 +102,7 @@ class timed_event {

std::string const& name() const noexcept;
};
}
} // namespace com::centreon::engine

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion engine/src/events/timed_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ time_t adjust_timestamp_for_time_change(int64_t time_difference, time_t ts) {
*/
int timed_event::handle_timed_event() {
typedef void (timed_event::*exec_event)();
static std::array<exec_event, 19> tab_exec_event{
static std::array<exec_event, 18> tab_exec_event{
&timed_event::_exec_event_service_check,
&timed_event::_exec_event_command_check,
&timed_event::_exec_event_log_rotation,
Expand Down

0 comments on commit 5a961fe

Please sign in to comment.