Skip to content

Commit

Permalink
fix next_check synchronisation
Browse files Browse the repository at this point in the history
last_update wasn't updated in some cases when only the next_check advances. For example for
pending and disabled hosts/services.
This patch ensures, that whenever next_check is updated, also last_update is set.
  • Loading branch information
sni committed Nov 11, 2020
1 parent 491ba93 commit 12897c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/naemon/checks_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ void schedule_next_host_check(host *hst, time_t delay, int options)
/* Schedule the event */
hst->check_options = options;
hst->next_check = delay + current_time;
hst->last_update = current_time;
hst->next_check_event = schedule_event(delay, handle_host_check_event, (void *)hst);

/* update the status log, since next_check and check_options is updated */
Expand Down
1 change: 1 addition & 0 deletions src/naemon/checks_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ void schedule_next_service_check(service *svc, time_t delay, int options)
/* Schedule the event */
svc->check_options = options;
svc->next_check = delay + current_time;
svc->last_update = current_time;
svc->next_check_event = schedule_event(delay, handle_service_check_event, (void *)svc);

/* update the status log, since next_check and check_options is updated */
Expand Down

0 comments on commit 12897c8

Please sign in to comment.