summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--lib/Smokeping.pm10
-rw-r--r--lib/Smokeping/Graphs.pm2
3 files changed, 13 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index b34bacd..9f7bdec 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,6 @@
-* fixed problem with rounding error in calculating stddev
+* don't complain when there is no data in a graph yet while calculation stddev -- tobi
+* in a multihost graph take the number of pings for each component into consideration -- tobi
+* fixed problem with rounding error in calculating stddev -- tobi
* include the prototype.js license for completeness -- niko
* fix Smokeping.pm POD documentation -- niko
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index cb6a0f3..05ace24 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -685,6 +685,7 @@ sub get_overview ($$$$){
my $pings = $probe->_pings($tree->{$prop});
my $i = 0;
my @colors = split /\s+/, $cfg->{Presentation}{multihost}{colors};
+ my $ProbeUnit = $probe->ProbeUnit();
for my $slave (@slaves){
$i++;
my $rrd;
@@ -698,7 +699,15 @@ sub get_overview ($$$$){
my ($host,$real_slave) = split /~/, $tree_path[-1]; #/
$tree_path[-1]= $host;
my $tree = get_tree($cfg,\@tree_path);
+ # not all multihost entries must have the same number of pings
+ $probe = $probes->{$tree->{$prop}{probe}};
+ $pings = $probe->_pings($tree->{$prop});
$label = $tree->{menu};
+ # if there are multiple units ... lets say so ...
+ if ($ProbeUnit ne $probe->ProbeUnit()){
+ $ProbeUnit = 'var units';
+ }
+
if ($real_slave){
$label .= "<". $cfg->{Slaves}{$real_slave}{display_name};
}
@@ -742,7 +751,6 @@ sub get_overview ($$$$){
"GPRINT:avmsr$i:%5.1lf %s am/as\\l";
}
- my $ProbeUnit = $probe->ProbeUnit();
my ($graphret,$xs,$ys) = RRDs::graph
($cfg->{General}{imgcache}.$dir."/${prop}_mini.png",
# '--lazy',
diff --git a/lib/Smokeping/Graphs.pm b/lib/Smokeping/Graphs.pm
index f0d7bf7..895e3cb 100644
--- a/lib/Smokeping/Graphs.pm
+++ b/lib/Smokeping/Graphs.pm
@@ -208,7 +208,7 @@ sub get_multi_detail ($$$$;$){
$label = sprintf("%-20s",$label);
push @colors, $medc;
my $sdc = $medc;
- my $stddev = Smokeping::RRDhelpers::get_stddev($rrd,'median','AVERAGE',$realstart,$sigtime);
+ my $stddev = Smokeping::RRDhelpers::get_stddev($rrd,'median','AVERAGE',$realstart,$sigtime) || 0;
$sdc =~ s/^(......).*/${1}30/;
push @G,
"DEF:median$i=${rrd}:median:AVERAGE",