summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping.pm
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-09-16 17:12:25 +0200
committerTobi Oetiker <tobi@oetiker.ch>2007-09-16 17:12:25 +0200
commitb5b7c0f2dc7420cb4c322f571ae16743bd621b39 (patch)
treec4db951c7da3536a95a8bc51581c44e6501aa767 /lib/Smokeping.pm
parent246f2b329811de06711d2c60c1010106034a7eec (diff)
downloadsmokeping-b5b7c0f2dc7420cb4c322f571ae16743bd621b39.tar.gz
smokeping-b5b7c0f2dc7420cb4c322f571ae16743bd621b39.tar.xz
* 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
Diffstat (limited to 'lib/Smokeping.pm')
-rw-r--r--lib/Smokeping.pm10
1 files changed, 9 insertions, 1 deletions
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',