[Nagios-devel] [PATCH 1/2] base/notifications: Do send

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH 1/2] base/notifications: Do send

Post by Guest »

From: Robin Sonefors

So, this was a bit silly...

When checking a service alert's notification viability, we forgot
to check if the alert was about a recovery before ensuring that the
recovery was valid to send out. This means that people who've tried
upgrading have usually received some notifications - just enough not to
think too hard about it - and people who haven't have still received
other types of notifications.

Signed-off-by: Robin Sonefors
---
base/notifications.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/base/notifications.c b/base/notifications.c
index dc3d93f..2991c28 100644
--- a/base/notifications.c
+++ b/base/notifications.c
@@ -514,7 +514,7 @@ int check_service_notification_viability(service *svc, int type, int options) {
log_debug_info(DEBUGL_NOTIFICATIONS, 1, "We shouldn't notify about %s states for this service.\n", service_state_name(svc->current_state));
return ERROR;
}
- if(svc->notified_on == 0) {
+ if(svc->current_state == STATE_OK && svc->notified_on == 0) {
log_debug_info(DEBUGL_NOTIFICATIONS, 1, "We shouldn't notify about this recovery.\n");
return ERROR;
}
--
1.7.11.7






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: robin.sonefors@op5.com
Locked