[smokeping-users] weird 'someloss' alert behaviour

Leos Bitto smokeping at leos.cz
Tue Sep 6 15:40:44 MEST 2005


Hello,

I have started playing with sending alerts from my already working 
SmokePing installation. I use the latest-and-greatest version 2.0.1 
(thanks for the great work!) and I have a problem with the alert called 
someloss in the distributed sample configuration file. It looks like this:

+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times  in a row

When I interpret it according to the documentation at 
http://people.ee.ethz.ch/~oetiker/webtools/smokeping/doc/smokeping_config.en.html 
- especially this part:

-----------------------------------------------------------------------
Sometimes it may be that conditions occur at irregular intervals. But 
still you only want to throw an alert if they occur several times within 
a certain amount of times. The operator *X* will ignore up to X values 
and still let the pattern match:

  >10%,*10*,>10%

will fire if more than 10% of the packets have been lost at least twice 
over the last 10 samples.
-----------------------------------------------------------------------

I would expect that for a host which is down (100% packet loss all the 
time) this alert would send me an e-mail after three testing iterations. 
That does not happen. I have to wait for 27 iterations until I get the 
first e-mail. After that I get an additional e-mail every iteration, but 
that's understandable.

So what's wrong - the behaviour, or the documentation? Should the 
documenation be corrected to have "The operator *X* will ignore exactly 
X values..."?

BTW, when I used the parameter --debug-daemon smokeping wrote this:

### Compiling alert detector pattern 'someloss'
### >0%,*12*,>0%,*12*,>0%
sub {
     my $d = shift;
     my $y = $d->{loss};
     for(1){
         my $imax2 = 12;
         my $imax1 = 12;
         next if scalar @$y < 27 ;
         my $i1;
         for($i1=0; $i1<$imax1;$i1++){
             my $i2;
             for($i2=0; $i2<$imax2;$i2++){
                 next unless defined $y->[-3-$i1-$i2]
                                 and $y->[-3-$i1-$i2] =~ /^\d/
                                 and $y->[-3-$i1-$i2] > 0;
                 last;
             }
             return 0 if $i2 >= $imax2;
             next unless defined $y->[-2-$i1]
                             and $y->[-2-$i1] =~ /^\d/
                             and $y->[-2-$i1] > 0;
             last;
         }
         return 0 if $i1 >= $imax1;
         next unless defined $y->[-1]
                         and $y->[-1] =~ /^\d/
                         and $y->[-1] > 0;
         return 1;
     }
     return 0;
}


Leos

--
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