On Tue, 9 Oct 2001, Andrew Ryan wrote:
> But I would like such a configurable keyword, because upalerts are
> useful and it's nice to know if something comes back on its own and you don't
> have to worry about it anymore, even if it is outside the period of time you
> would care about the service going out.
>
> If it was coded up, would you accept the patch?
sure, if it's not a horrible hack. i would imagine some simple new flag
such as this:
...
period _DAYTIME_
alert mail.alert mis
period wd {Sun-Sat}
no_comp_alerts
catch_all_upalerts
upalert mail.alert mis
and change the code in do_alert to look like this:
#
# skip upalerts not paired with down alerts
# disable by setting "no_comp_alerts" in period section
#
if (!$pref->{"no_comp_alerts"} && !$pref->{"catch_all_upalerts"} &&
($flags & $FL_UPALERT) && !$pref->{"_alert_sent"})
{
next;
}
and add this to read_cf:
elsif ($var eq "no_comp_alerts")
{
$pref->{"no_comp_alerts"} = 1;
next;
}
elsif ($var eq "catch_all_upalerts")
{
$pref->{"catch_all_upalerts"} = 1;
next;
}
...or something to that effect. i haven't tried that nor spend more than
3 minutes looking into it, but it might work.