Skip to content

Commit

Permalink
check global enable_flap_detection flag for notifications
Browse files Browse the repository at this point in the history
if global enable_flap_detection has been disabled but hosts/services still
have the is_flapping flag set, notifications will be held back forever.

the quick fix is to ignore the flapping state if its disabled globally.

Signed-off-by: Sven Nierlein <[email protected]>
  • Loading branch information
sni committed Feb 8, 2024
1 parent f454e25 commit f852cea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/naemon/notifications.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ int check_service_notification_viability(service *svc, int type, int options)
}

/* if this service is currently flapping, don't send the notification */
if (svc->is_flapping == TRUE) {
if (enable_flap_detection == TRUE && svc->flap_detection_enabled == TRUE && svc->is_flapping == TRUE) {
LOG_SERVICE_NSR(NSR_IS_FLAPPING);
return ERROR;
}
Expand Down Expand Up @@ -1654,7 +1654,7 @@ int check_host_notification_viability(host *hst, int type, int options)
}

/* if this host is currently flapping, don't send the notification */
if (hst->is_flapping == TRUE) {
if (enable_flap_detection == TRUE && hst->flap_detection_enabled == TRUE && hst->is_flapping == TRUE) {
LOG_HOST_NSR(NSR_IS_FLAPPING);
return ERROR;
}
Expand Down

0 comments on commit f852cea

Please sign in to comment.