[Nagios-devel] Patch for recovery notifications on dependent hosts

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 for recovery notifications on dependent hosts

Post by Guest »

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi all,

it seems nagios sends recovery notifications when a host that
depends on another one comes back, as the latter one just came
back too (eg a router on the way).

Hopefully the attached patch can help solve this issue.

hth
--
Henri Fallon

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="nagios_dependent_recovery.diff"

Index: base/checks.c
===================================================================
RCS file: /cvsroot/nagios/nagios/base/checks.c,v
retrieving revision 1.54
diff -U3 -r1.54 checks.c
--- base/checks.c 3 Sep 2003 23:50:58 -0000 1.54
+++ base/checks.c 8 Oct 2003 15:59:52 -0000
@@ -1470,7 +1470,14 @@
if(temp_dependency->inherits_parent==TRUE){
if(check_service_dependencies(temp_service,dependency_type)!=DEPENDENCIES_OK)
return DEPENDENCIES_FAILED;
- }
+ /* if the host we depend on is UP, but has been down, don't send recovery message */
+ if(temp_host->has_been_down==TRUE && temp_host->status==HOST_UP && temp_dependency->fail_on_down==TRUE)
+ return DEPENDENCIES_FAILED;
+ /* same for unreachable */
+ if(temp_host->has_been_unreachable==TRUE && temp_host->status==HOST_UP && temp_dependency->fail_on_unreachable==TRUE)
+ return DEPENDENCIES_FAILED;
+ }
+
}

#ifdef DEBUG0

--xHFwDpU9dbj6ez1V--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked