[Nagios-devel] Patch: Fix spurious host check orphan messages

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: Fix spurious host check orphan messages

Post by Guest »

In testing Nagios 3 I've found that I often get host check orphan
warnings, even when the host check actually completed successfully.
This seems to be happening because the next_check time is incorrect
in an on-demand check--either it's 0 because the host had never been
checked, or it's from the last time the host was checked, which could
be hours or days ago. This causes check_for_orphaned_hosts to think
that the check is way overdue even though it actually isn't.

This patch corrects that problem by setting the host's next_check
time to the current time when performing on-demand checks.

Thanks,
Luke

--- checks.c.orig 2008-05-15 10:23:40.000000000 -0500
+++ checks.c 2008-05-15 10:55:18.000000000 -0500
@@ -2908,6 +2908,10 @@

/* get the command start time */
gettimeofday(&start_time,NULL);
+
+ /* set check time for on demand checks so they're not incorrectly
detected as orphaned */
+ if(scheduled_check==FALSE)
+ hst->next_check=start_time.tv_sec;

/* increment number of host checks that are currently running... */
currently_running_host_checks++;







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