[smokeping-users] DNS probe - sqrt error
Ken Dreyer
ktdreyer at gmail.com
Tue Sep 11 13:55:31 CEST 2007
Works great!
Thanks Tobi.
- Ken
On 9/11/07, Tobias Oetiker <tobi at oetiker.ch> wrote:
> Hi Ken,
>
> I guess we are hitting a rounding error here ...
>
> Index: Smokeping/RRDhelpers.pm
> ===================================================================
> --- Smokeping/RRDhelpers.pm (revision 820)
> +++ Smokeping/RRDhelpers.pm (working copy)
> @@ -52,7 +52,8 @@
> }
> }
> return undef unless $cnt;
> - return sqrt( 1.0 / $cnt * ( $sqsum - $sum**2 / $cnt ))
> + my $sqdev = 1.0 / $cnt * ( $sqsum - $sum**2 / $cnt );
> + return $sqdev < 0.0 ? 0.0 : sqrt($sqdev);
> }
>
>
> or is my stdev math worng ?
>
> cheers
> tobi
>
>
> Yesterday Ken Dreyer wrote:
>
> > When I try to view the webpage for a particular DNS target, I get the
> > following error:
> >
> > Can't take sqrt of -4.62018e-22 at
> > /usr/local/smokeping/lib/Smokeping/RRDhelpers.pm line 55.
> >
> > ...but the problem is intermittent. One target in particular almost
> > always gives the error when I view its page. Once it occurred on all
> > my DNS targets; and sometimes it doesn't happen on any of them. I'm
> > using the normal dig probe:
> >
> > $ dig -v
> > DiG 9.3.4-P1
> >
> > with a fresh install of smokeping 2.2.2:
> >
> > /usr/local/smokeping/bin/smokeping --version
> > 2.002002
> >
> > Has anyone else experienced this error?
> >
> > - Ken
> >
> >
>
> --
> Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
> http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902
>
More information about the smokeping-users
mailing list