Lines 351-363
void init_timing_loop(void) {
Link Here
|
351 |
*/ |
351 |
*/ |
352 |
check_delay = |
352 |
check_delay = |
353 |
mult_factor * scheduling_info.service_inter_check_delay; |
353 |
mult_factor * scheduling_info.service_inter_check_delay; |
354 |
time_t check_window = reschedule_within_timeperiod(next_valid_time, temp_service->check_period_ptr, check_window(temp_service)) - current_time; |
354 |
if(check_delay > check_window(temp_service)) { |
355 |
if(check_delay > check_window) { |
|
|
356 |
log_debug_info(DEBUGL_EVENTS, 0, |
355 |
log_debug_info(DEBUGL_EVENTS, 0, |
357 |
" Fixing check time %lu secs too far away\n", |
356 |
" Fixing check time %lu secs too far away\n", |
358 |
check_delay - check_window); |
357 |
check_delay - check_window(temp_service)); |
359 |
fixed_services++; |
358 |
fixed_services++; |
360 |
check_delay = check_window; |
359 |
check_delay = check_window(temp_service); |
361 |
log_debug_info(DEBUGL_EVENTS, 0, " New check offset: %d\n", |
360 |
log_debug_info(DEBUGL_EVENTS, 0, " New check offset: %d\n", |
362 |
check_delay); |
361 |
check_delay); |
363 |
} |
362 |
} |
Lines 370-376
void init_timing_loop(void) {
Link Here
|
370 |
if(is_valid_time == ERROR) { |
369 |
if(is_valid_time == ERROR) { |
371 |
log_debug_info(DEBUGL_EVENTS, 2, "Preferred Time is Invalid In Timeperiod '%s': %lu --> %s\n", temp_service->check_period_ptr->name, (unsigned long)temp_service->next_check, ctime(&temp_service->next_check)); |
370 |
log_debug_info(DEBUGL_EVENTS, 2, "Preferred Time is Invalid In Timeperiod '%s': %lu --> %s\n", temp_service->check_period_ptr->name, (unsigned long)temp_service->next_check, ctime(&temp_service->next_check)); |
372 |
get_next_valid_time(temp_service->next_check, &next_valid_time, temp_service->check_period_ptr); |
371 |
get_next_valid_time(temp_service->next_check, &next_valid_time, temp_service->check_period_ptr); |
373 |
temp_service->next_check = reschedule_within_timeperiod(next_valid_time, temp_service->check_period_ptr, check_window(temp_service)); |
372 |
temp_service->next_check = |
|
|
373 |
(time_t)(next_valid_time + check_delay); |
374 |
} |
374 |
} |
375 |
|
375 |
|
376 |
log_debug_info(DEBUGL_EVENTS, 2, "Actual Check Time: %lu --> %s\n", (unsigned long)temp_service->next_check, ctime(&temp_service->next_check)); |
376 |
log_debug_info(DEBUGL_EVENTS, 2, "Actual Check Time: %lu --> %s\n", (unsigned long)temp_service->next_check, ctime(&temp_service->next_check)); |
Lines 508-514
void init_timing_loop(void) {
Link Here
|
508 |
log_debug_info(DEBUGL_EVENTS, 1, "Fixing check time (off by %lu)\n", |
508 |
log_debug_info(DEBUGL_EVENTS, 1, "Fixing check time (off by %lu)\n", |
509 |
check_delay - check_window(temp_host)); |
509 |
check_delay - check_window(temp_host)); |
510 |
fixed_hosts++; |
510 |
fixed_hosts++; |
511 |
check_delay = reschedule_within_timeperiod(next_valid_time, temp_host->check_period_ptr, check_window(temp_host)); |
511 |
check_delay = ranged_urand(0, check_window(temp_host)); |
512 |
} |
512 |
} |
513 |
temp_host->next_check = (time_t)(current_time + check_delay); |
513 |
temp_host->next_check = (time_t)(current_time + check_delay); |
514 |
|
514 |
|