[smokeping-users] Re: How to stop alert from triggering on each cycle?

Tobias Oetiker oetiker at ee.ethz.ch
Mon May 9 21:37:12 MEST 2005


Hi Marc,

if this was to be implemented then it would have to be in the form
of an option to set when defining the alert ... niko ? feel like
adding this :-)

cheers
tobi


> Hi Tobi,
>
> On Sun, May 08, 2005 at 09:57:28PM +0200, Tobias Oetiker wrote:
> > Today Marc Haber wrote:
> > > Additionally the manpage text ">10%,*10*,>10% will fire if more than
> > > 10% of the packets have been losst twice over the last 10 samples." is
> > > wrong. It will fire if more than 10% of the packets have been lost
> > > _at_ _least_ twice over the last 10 samples.
> >
> > sorry yes ... exactly as wrong as if I say, you loose your driving
> > license if you are caught driving faster than 100 MPH twice, since
> > this would imply that you would NOT lookse the license if you were
> > caught three times ... right ? :-) in any event, I changed the
> > docus in the 2.0 svn archive to not further confuse readers ...
>
> Thanks for the clarification.
>
> This makes writing smokeping alerts, IMO, unnecessarily hard and
> error-prone. Unfortunately, I don't quite understand the code that
> builds the alerts subroutine in init_alerts and agree that this code
> is already complicated enough.
>
> I don't know enough about object oriented perl to write correct code,
> but I'd like to suggest something nevertheless. I hope that you
> understand me.
>
> That code needs to be in the update_rrds subroutine.
>
> if ( $tree->{alerts} ) {
>   $tree->{stack} = {loss=>['S'],rtt=>['S']} unless defined $tree->{stack};
>   my $x = $tree->{stack};
>   my $lastalert = &{$cfg->{Alerts}{$_}{sub}}($x);
>   my ($loss,$rtt) = (split /:/,
>       $probeobj->rrdupdate_string($tree))[1,2];
>   <snip>
>
>   if ( &{$cfg->{Alerts}{$_}{sub}}($x) ){
>     # we got a match
>     <snip>
>     do_log("Alert $_ triggered for $line");
>     <snip>
>     if ( ! $lastalert ) {
>       # generate actual notifications
>     }
>   } else {
>     if ( $lastalert ) {
>       do_log("Alert $_ not triggered any more for $line");
>       # generate "all is fine" notifications
>     }
> }
>
> That way, smokeping would only set messages when an alert matches for
> the first time in a row, and when a row of alerts finishs, by first
> determining if the alert matched in the last round, and only sending
> notifications if the status changed. It's a small change and would
> make notifications _much_ easier.
>
> Greetings
> Marc
>
>

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker @ ISG.EE, ETL F24.2, ETH, CH-8092 Zurich
 / // _ \/ _ \/ /  System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/oetiker +41(0)44-632-5286

--
Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/smokeping-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the smokeping-users mailing list