[smokeping-users] FPing: Use of uninitialized value in division

amedee at amedee.be amedee at amedee.be
Fri Apr 21 15:08:23 MEST 2006


Hello,

I installed smokeping a few months ago but haven't been able to get in to
work properly.
Running it in debug gives me the following output:

/usr/sbin/smokeping --debug
### Compiling alert detector pattern 'startloss'
### ==S,>0%,>0%,>0%
sub {
    my $d = shift;
    my $y = $d->{loss};
    for(1){
        next if scalar @$y < 4 ;
        next unless defined $y->[-4] and $y->[-4] eq 'S';
        next unless defined $y->[-3]
                        and $y->[-3] =~ /^\d/
                        and $y->[-3] > 0;
        next unless defined $y->[-2]
                        and $y->[-2] =~ /^\d/
                        and $y->[-2] > 0;
        next unless defined $y->[-1]
                        and $y->[-1] =~ /^\d/
                        and $y->[-1] > 0;
        return 1;
    }
    return 0;
}

### 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;
}



### Compiling alert detector pattern 'rttdetect'
### <10,<10,<10,<10,<10,<100,>100,>100,>100
sub {
    my $d = shift;
    my $y = $d->{rtt};
    for(1){
        next if scalar @$y < 9 ;
        next unless defined $y->[-9]
                        and $y->[-9] =~ /^\d/
                        and $y->[-9] < 0.01;
        next unless defined $y->[-8]
                        and $y->[-8] =~ /^\d/
                        and $y->[-8] < 0.01;
        next unless defined $y->[-7]
                        and $y->[-7] =~ /^\d/
                        and $y->[-7] < 0.01;
        next unless defined $y->[-6]
                        and $y->[-6] =~ /^\d/
                        and $y->[-6] < 0.01;
        next unless defined $y->[-5]
                        and $y->[-5] =~ /^\d/
                        and $y->[-5] < 0.01;
        next unless defined $y->[-4]
                        and $y->[-4] =~ /^\d/
                        and $y->[-4] < 0.1;
        next unless defined $y->[-3]
                        and $y->[-3] =~ /^\d/
                        and $y->[-3] > 0.1;
        next unless defined $y->[-2]
                        and $y->[-2] =~ /^\d/
                        and $y->[-2] > 0.1;
        next unless defined $y->[-1]
                        and $y->[-1] =~ /^\d/
                        and $y->[-1] > 0.1;
        return 1;
    }
    return 0;
}

### Compiling alert detector pattern 'bigloss'
### ==0%,==0%,==0%,==0%,>0%,>0%,>0%
sub {
    my $d = shift;
    my $y = $d->{loss};
    for(1){
        next if scalar @$y < 7 ;
        next unless defined $y->[-7]
                        and $y->[-7] =~ /^\d/
                        and $y->[-7] == 0;
        next unless defined $y->[-6]
                        and $y->[-6] =~ /^\d/
                        and $y->[-6] == 0;
        next unless defined $y->[-5]
                        and $y->[-5] =~ /^\d/
                        and $y->[-5] == 0;
        next unless defined $y->[-4]
                        and $y->[-4] =~ /^\d/
                        and $y->[-4] == 0;
        next unless defined $y->[-3]
                        and $y->[-3] =~ /^\d/
                        and $y->[-3] > 0;
        next unless defined $y->[-2]
                        and $y->[-2] =~ /^\d/
                        and $y->[-2] > 0;
        next unless defined $y->[-1]
                        and $y->[-1] =~ /^\d/
                        and $y->[-1] > 0;
        return 1;
    }
    return 0;
}

Launched successfully
Not entering multiprocess mode with '--debug'. Use '--debug-daemon' for
that. FPing: probing 2 targets with step 300 s and offset 178 s.
FPing: Executing /usr/sbin/fping -C 20 -q -B1 -i10 -r1
breedband.telenet.be www.gandi.net
Use of uninitialized value in division (/) at
/usr/share/perl5/smokeping/probes/FPing.pm line 108, <GEN2> line 1.
Illegal division by zero at /usr/share/perl5/smokeping/probes/FPing.pm
line 108, <GEN2> line 1.



I searched the mailing list and found a patch for FPing.pm, but this patch
was already applied to the version debian installed for me.


Just running fping gives me this:

> fping -C 5 breedband.telenet.be
breedband.telenet.be : [0], 84 bytes, 21.1 ms (21.1 avg, 0% loss)
breedband.telenet.be : [1], 84 bytes, 20.1 ms (20.6 avg, 0% loss)
breedband.telenet.be : [2], 84 bytes, 19.7 ms (20.3 avg, 0% loss)
breedband.telenet.be : [3], 84 bytes, 20.1 ms (20.2 avg, 0% loss)
breedband.telenet.be : [4], 84 bytes, 20.3 ms (20.2 avg, 0% loss)

breedband.telenet.be : 21.11 20.12 19.79 20.11 20.34

> fping -C 5 www.gandi.net
www.gandi.net : [0], 84 bytes, 17.0 ms (17.0 avg, 0% loss)
www.gandi.net : [1], 84 bytes, 16.3 ms (16.6 avg, 0% loss)
www.gandi.net : [2], 84 bytes, 16.2 ms (16.5 avg, 0% loss)
www.gandi.net : [3], 84 bytes, 16.0 ms (16.3 avg, 0% loss)
www.gandi.net : [4], 84 bytes, 16.2 ms (16.3 avg, 0% loss)

So apparently there is no problem with fping itself?

What could be the problem?

-- 
Amedee Van Gasse



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