Index: lib/loadalerts.c =================================================================== --- lib/loadalerts.c (revision 7345) +++ lib/loadalerts.c (working copy) @@ -981,6 +981,8 @@ * this check to all messages. */ if (crit && crit->timespec && !timematch(xmh_item(hinfo, XMH_HOLIDAYS), crit->timespec)) { + /* Try again in a minute */ + if (nexttime) *nexttime = getcurrenttime(NULL) + 60; traceprintf("Failed '%s' (time criteria)\n", cfline); if (!printmode) return 0; } Index: xymond/do_alert.c =================================================================== --- xymond/do_alert.c (revision 7345) +++ xymond/do_alert.c (working copy) @@ -692,28 +692,22 @@ stoprulefound = 0; while (!stoprulefound && ((recip = next_recipient(alert, &first, NULL, &r_next)) != NULL)) { + void *hinfo = hostinfo(alert->hostname); + found = 1; - /* - * This runs in the parent xymond_alert proces, so we must create - * a repeat-record here - or all alerts will get repeated every minute. - */ - rpt = find_repeatinfo(alert, recip, 1); - if (rpt) { - if (rpt->nextalert <= now) rpt->nextalert = (now + recip->interval); - if (rpt->nextalert < nexttime) nexttime = rpt->nextalert; + + if (recip->criteria && recip->criteria->timespec && !timematch(xmh_item(hinfo, XMH_HOLIDAYS), recip->criteria->timespec)) { + /* Recipient not active due to time-restrictions. */ + if ((r_next != -1) && (r_next < nexttime)) nexttime = r_next; } - else if (r_next != -1) { - if (r_next < nexttime) nexttime = r_next; - } else { /* - * This can happen, e.g. if we get an alert, but the minimum - * DURATION has not been met. - * This simply means we dropped the alert -for now - for some - * reason, so it should be retried again right away. Put in a - * 1 minute delay to prevent run-away alerts from flooding us. + * This runs in the parent xymond_alert proces, so we must create + * a repeat-record here - or all alerts will get repeated every minute. */ - if ((now + 60) < nexttime) nexttime = now + 60; + rpt = find_repeatinfo(alert, recip, 1); + if (rpt->nextalert <= now) rpt->nextalert = (now + recip->interval); + if (rpt->nextalert < nexttime) nexttime = rpt->nextalert; } } Index: xymond/xymond_alert.c =================================================================== --- xymond/xymond_alert.c (revision 7345) +++ xymond/xymond_alert.c (working copy) @@ -212,6 +212,7 @@ case SIGCHLD: break; + case SIGHUP: case SIGUSR1: nextcheckpoint = 0; break; @@ -506,6 +507,7 @@ sigaction(SIGINT, &sa, NULL); sigaction(SIGCHLD, &sa, NULL); sigaction(SIGUSR1, &sa, NULL); + sigaction(SIGHUP, &sa, NULL); if (xgetenv("XYMONSERVERLOGS")) { sprintf(acklogfn, "%s/acknowledge.log", xgetenv("XYMONSERVERLOGS"));