summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2005-07-29 10:14:17 +0200
committerTobi Oetiker <tobi@oetiker.ch>2005-07-29 10:14:17 +0200
commitcaea6ae36aaacadab7029f172821899d237108f4 (patch)
treef0c9d35a8d7108bfeeafa9c16e1d28fae9e90e58
parent7c05e52c7486b782ea8fe83f61eda56f05fd2613 (diff)
downloadsmokeping-caea6ae36aaacadab7029f172821899d237108f4.tar.gz
smokeping-caea6ae36aaacadab7029f172821899d237108f4.tar.xz
set LC_NUMERIC to C to help people that would otherwhise get , as decimal separator
-rw-r--r--CHANGES4
-rw-r--r--lib/Smokeping.pm17
2 files changed, 19 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 465da61..de0fd06 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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>" );