Skip to content

Commit

Permalink
fix host not being in hard state with max_check_attempts=1 (fixes #473)
Browse files Browse the repository at this point in the history
a host should directly change into a hard state when max_check_attempts=1 is set and the host goes down.
  • Loading branch information
sni committed Sep 13, 2024
1 parent 4c61e99 commit fc93bc0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/naemon/checks_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,10 @@ static int process_host_check_result(host *hst, host *prev, int *alert_recorded)
if (hst->check_type == CHECK_TYPE_ACTIVE || passive_host_checks_are_soft == TRUE) {

/* set the state type */
hst->state_type = SOFT_STATE;
if (hst->current_attempt == hst->max_attempts)
hst->state_type = HARD_STATE;
else
hst->state_type = SOFT_STATE;
}

/* by default, passive check results are treated as HARD states */
Expand Down

0 comments on commit fc93bc0

Please sign in to comment.