Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed missing OK HARD state after OK SOFT. #472

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/naemon/checks_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,9 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
/* this is a soft recovery */
temp_service->state_type = SOFT_STATE;

/* this is a soft recovery */
temp_service->last_state_was_soft_recovery = TRUE;

/* log the soft recovery */
log_service_event(temp_service);
alert_recorded = NEBATTR_CHECK_ALERT;
Expand All @@ -851,6 +854,14 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
/* else no service state change has occurred... */
else {
log_debug_info(DEBUGL_CHECKS, 1, "Service did not change state.\n");

if (temp_service->last_state_was_soft_recovery == TRUE) {
/* log the hard state after the last check which was a soft recovery */
log_service_event(temp_service);
alert_recorded = NEBATTR_CHECK_ALERT;
}

temp_service->last_state_was_soft_recovery = FALSE;
}

/* should we obsessive over service checks? */
Expand Down
1 change: 1 addition & 0 deletions src/naemon/objects_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct service {
int acknowledgement_type;
time_t acknowledgement_end_time;
int host_problem_at_last_check;
int last_state_was_soft_recovery;
int check_type;
int current_state;
int last_state;
Expand Down
Loading