[Mon-commit] mon mon,1.4.2.13,1.4.2.14
Brought to you by:
trockij
|
From: Jim T. <tr...@us...> - 2004-11-19 18:27:57
|
Update of /cvsroot/mon/mon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28690 Modified Files: Tag: mon-1-0-0pre1 mon Log Message: added some comments to better explain the alert suppression in do_alert, added ignore_summary from head Index: mon =================================================================== RCS file: /cvsroot/mon/mon/mon,v retrieving revision 1.4.2.13 retrieving revision 1.4.2.14 diff -C2 -d -r1.4.2.13 -r1.4.2.14 *** mon 13 Aug 2004 04:15:16 -0000 1.4.2.13 --- mon 19 Nov 2004 18:27:47 -0000 1.4.2.14 *************** *** 594,606 **** # output from monitor is different or if strict alertevery # my ($prevsumm) = split("\n", $sref->{"_failure_output"}); if ( ! $pref->{"alertevery"} != 0 && ( ! ($tmnow - $pref->{"_last_alert"} < $pref->{"alertevery"}) && ( ! ($pref->{"_alertevery_strict"}) || ! ($pref->{"_observe_detail"} && $sref->{"_failure_output"} eq $output) || ! (!$pref->{"_observe_detail"} && $prevsumm eq $summary) ) ) --- 594,612 ---- # output from monitor is different or if strict alertevery # + # strict and _ignore_summary are basically the same though + # strict short-circuits and overrides other settings and exists + # for compatibility with pre-1.1 configs + # my ($prevsumm) = split("\n", $sref->{"_failure_output"}); if ( ! $pref->{"alertevery"} != 0 && # if alertevery is set and ( ! ($tmnow - $pref->{"_last_alert"} < $pref->{"alertevery"}) && # we're within the time period and one of these: ( ! ($pref->{"_alertevery_strict"}) || # [ strict is set or ! ($pref->{"_observe_detail"} && $sref->{"_failure_output"} eq $output) || # observing detail and output hasn't changed or ! (!$pref->{"_observe_detail"} && $prevsumm eq $summary) || # not observing detail ! # and not ignoring summary and summ hasn't changed or ! ($pref->{"_ignore_summary"}) # we're ignoring summary changes ] ) ) *************** *** 1298,1301 **** --- 1304,1308 ---- $pref->{"_observe_detail"} = 0; $pref->{"_alertevery_strict"} = 0; + $pref->{"_ignore_summary"} = 0; if ($args =~ /(\S+) \s+ observe_detail \s*$/ix) *************** *** 1305,1308 **** --- 1312,1321 ---- } + elsif ($args =~ /(\S+) \s+ ignore_summary \s*$/ix) + { + $pref->{"_ignore_summary"} = 1; + $args = $1; + } + # # for backawards-compatibility with <= 0.38.21 *************** *** 1318,1328 **** elsif ($args =~ /(\S+) \s+ strict \s*$/ix) { - $args = $1; $pref->{"_alertevery_strict"} = 1; } if (!($args = dhmstos ($args))) { close (CFG); ! return "cf error: invalid time interval '$args' (syntax: alertevery {positive number}{smhd} [ strict | observe_detail ]), line $line_num"; } --- 1331,1341 ---- elsif ($args =~ /(\S+) \s+ strict \s*$/ix) { $pref->{"_alertevery_strict"} = 1; + $args = $1; } if (!($args = dhmstos ($args))) { close (CFG); ! return "cf error: invalid time interval '$args' (syntax: alertevery {positive number}{smhd} [ strict | observe_detail | ignore_summary ]), line $line_num"; } |