Funny no one never noticed this one before. Fortunately it's an easy fix.
The problem is that the 'test monitor' command only resets the _timer, and
not the _next_check, so when the monitor finishes executing, reset_timer()
thinks the monitor needs to be run next in (_next_check + _interval)
seconds. The solution is to zero out _next_check when a manual monitor test
is invoked.
Here's the patch against 0.99.2:
$ diff -c mon.orig mon
*** mon.orig Sat Sep 8 06:42:05 2001
--- mon Sat Oct 6 12:17:47 2001
***************
*** 1944,1949 ****
--- 1944,1950 ----
sock_write ($fh, "$group $service not defined\n");
} else {
$watch{$group}->{$service}->{"_timer"} = 0;
+ $watch{$group}->{$service}->{"_next_check"} = 0;
}
sock_write ($fh, "220 test monitor completed\n");
At 10:38 PM 10/5/01 -0400, Ed Ravin wrote:
>I noticed this the other day - if you use the "test" command in mon,
>then the next scheduled test will be postponed by the testing interval.
>If you have a 5 minute interval and you try testing 3 times in a row
>just to make sure something works, the watch will not get tested again
>for another 15-20 minutes. Not too big a deal but a little unexpected.
>
> -- Ed