diff options
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | lib/Smokeping.pm | 17 |
2 files changed, 19 insertions, 2 deletions
@@ -1,3 +1,7 @@ +* set LC_NUMERIC to C so that users who work with a locale like french that + would use , as a decimal separator do not trip over failing regexp-matches + (tobi) + * bugfix for CiscoRTTMonEchoICMP packetsize variable -- niko, from Sam Stickland <sam_ml *spacething.org> * tune DS properties min/max/heartbeat instead of just complaing about diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 641c651..5d28b78 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -12,8 +12,15 @@ use POSIX; use Config::Grammar; use RRDs; use Sys::Syslog qw(:DEFAULT setlogsock); + setlogsock('unix') if grep /^ $^O $/xo, ("linux", "openbsd", "freebsd", "netbsd"); + +# make sure we do not end up with , in odd places where one would expect a '.' +# we set the environment variable so that our 'kids' get the benefit too +$ENV{LC_NUMERIC}='C'; +POSIX::setlocale(&POSIX::LC_NUMERIC,""); + use File::Basename; use Smokeping::Examples; use Smokeping::RRDtools; @@ -877,7 +884,8 @@ sub get_detail ($$$$){ my @lazy =(); @lazy = ('--lazy') if $mode eq 's' and $lasthight{$start} and $lasthight{$start} == $max->{$start}; $desc = "Navigator Graph" if $mode eq 'n'; - my ($graphret,$xs,$ys) = RRDs::graph + my $timer_start = time(); + my @task = ("${imgbase}_${end}_${start}.png", @lazy, '--start',( $mode eq 's' ? '-'.$start : $start), @@ -910,11 +918,13 @@ sub get_detail ($$$$){ 'COMMENT:\s', "COMMENT:Probe${BS}: $pings $ProbeDesc every $step seconds", 'COMMENT:created on '.$date.'\j' ); + + my ($graphret,$xs,$ys) = RRDs::graph @task; my $ERROR = RRDs::error(); if ($mode eq 'n'){ $page .= "<div>"; - $page .= ( $ERROR || qq{<IMG BORDER="0" WIDTH="$xs" HEIGHT="$ys" SRC="${imghref}_${end}_${start}.png">} ); + $page .= ( $ERROR || qq|<IMG BORDER="0" WIDTH="$xs" HEIGHT="$ys" SRC="${imghref}_${end}_${start}.png">| ); $page .= "</div>"; $page .= $q->start_form(-method=>'GET') . "<p>Time range: " @@ -930,6 +940,9 @@ sub get_detail ($$$$){ $startstr =~ s/\s/%20/g; $endstr =~ s/\s/%20/g; $page .= "<div>"; +# $page .= (time-$timer_start)."<br/>"; +# $page .= join " ",map {"'$_'"} @task; + $page .= "<br/>"; $page .= ( $ERROR || qq{<a href="?displaymode=n;start=$startstr;end=now;}."target=".$q->param('target').'">' . qq{<IMG BORDER="0" WIDTH="$xs" HEIGHT="$ys" SRC="${imghref}_${end}_${start}.png">}."</a>" ); |