summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-08-30 08:55:46 +0200
committerTobi Oetiker <tobi@oetiker.ch>2007-08-30 08:55:46 +0200
commita7bd89a24de51921637ce3f297be362ad17d65ab (patch)
tree3af4a9a48e8a537907b0ebcdb723b35605d4323a
parent923cb59acf4245c851093b4fe465a62f97e1543d (diff)
downloadsmokeping-a7bd89a24de51921637ce3f297be362ad17d65ab.tar.gz
smokeping-a7bd89a24de51921637ce3f297be362ad17d65ab.tar.xz
integrated multi-host feature
-rw-r--r--CHANGES11
-rw-r--r--etc/config.dist15
-rw-r--r--lib/Smokeping.pm21
3 files changed, 27 insertions, 20 deletions
diff --git a/CHANGES b/CHANGES
index 8cde71d..eb91978 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,24 +1,17 @@
-* Added stddev caclulation -- tobi
+* Added multi-host function (show data from several links in one graph) -- tobi
+* Added stddev caclulation -- tobi
* Added slave support into detail graphs -- tobi
-
* Made interactive Graph zoomer somewhat work on ie6 and ie7 -- tobi
-
* Integrated interactive Graph zoomer -- Roman Plessl rplessl oetiker.ch
-
* first drop of the master/slave code added. now the debugging beginns. -- tobi
-
* fix uses of uninitialized value in the loss_background code
-- niko, reported by yilmaz.atag *abs.gov.au
-
* added description of the master/slave mode I am implementing
for dyndns -- tobi
-
* fixed smoke when there is a lot of 'loss' -- tobi
-
* do not use 127.0.0.1 when testing echoping and curl functionality. There may be someone
behind this address. -- Michael Hanselmann public hansmi ch
-
* show all smoke in the detail graphs, even if it's out of the scale. -- niko,
reported by Oskar Liljeblad <oskar *osk.mine.nu> as Debian bug #412826
diff --git a/etc/config.dist b/etc/config.dist
index 6e53e10..35369e6 100644
--- a/etc/config.dist
+++ b/etc/config.dist
@@ -113,10 +113,19 @@ title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
Here you will learn all about the latency of our network.
-+ James
++ Test
+menu= Targets
-menu = Test Target
-title =Test Target
+++ James
+
+menu = James
+title =James
alerts = someloss
slaves = boomer
host = james.oetiker.ch
+
+++ Summer
+
+menu = Summer Host
+title = My Favorite hosts
+host = /Test/James /Test/James~boomer
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index b3e5496..642ee83 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -17,6 +17,7 @@ use Smokeping::Colorspace;
use Smokeping::Master;
use Smokeping::Slave;
use Smokeping::RRDhelpers;
+use Smokeping::Graphs;
setlogsock('unix')
if grep /^ $^O $/xo, ("linux", "openbsd", "freebsd", "netbsd");
@@ -391,7 +392,7 @@ sub add_targets ($$$$){
if (ref $tree->{$prop} eq 'HASH'){
add_targets $cfg, $probes, $tree->{$prop}, "$name/$prop";
}
- if ($prop eq 'host' and check_filter($cfg,$name)) {
+ if ($prop eq 'host' and check_filter($cfg,$name) and $tree->{$prop} !~ m|^/| ) {
if($tree->{host} =~ /^DYNAMIC/) {
$probeobj->add($tree,$name);
} else {
@@ -434,7 +435,7 @@ sub init_target_tree ($$$$) {
};
init_target_tree $cfg, $probes, $tree->{$prop}, "$name/$prop";
}
- if ($prop eq 'host' and check_filter($cfg,$name) and $tree->{$prop} !~ /^\//) {
+ if ($prop eq 'host' and check_filter($cfg,$name) and $tree->{$prop} !~ m|^/|) {
# print "init $name\n";
my $step = $probeobj->step();
# we have to do the add before calling the _pings method, it won't work otherwise
@@ -697,9 +698,9 @@ sub get_overview ($$$$){
my ($host,$real_slave) = split /~/, $tree_path[-1]; #/
$tree_path[-1]= $host;
my $tree = get_tree($cfg,\@tree_path);
- $label = $tree->{host};
+ $label = $tree->{menu};
if ($real_slave){
- $label .= " <- ". $cfg->{Slaves}{$real_slave}{display_name};
+ $label .= "<". $cfg->{Slaves}{$real_slave}{display_name};
}
$label = sprintf("%-20s",$label);
push @colors, $medc;
@@ -788,7 +789,7 @@ sub findmax ($$) {
my $ERROR = RRDs::error();
do_log $ERROR if $ERROR;
my $val = $graphret->[0];
- $val = 1 if $val =~ /nan/i;
+ $val = 0 if $val =~ /nan/i;
$maxmedian{$start} = $val;
push @maxmedian, $val;
}
@@ -849,12 +850,16 @@ sub get_detail ($$$$;$){
# and the length of the graph.
# c) 'c' chart mode, one graph with a link to it's full page
# d) 'a' ajax mode, generate image based on given url and dump in on stdout
- #
+ #
my $cfg = shift;
my $q = shift;
my $tree = shift;
my $open = shift;
my $mode = shift || $q->param('displaymode') || 's';
+ if ($tree->{host} and $tree->{host} =~ m|^/|){
+ return Smokeping::Graphs::get_multi_detail($cfg,$q,$tree,$open,$mode);
+ }
+
my @slaves = ("");
if ($tree->{slaves} and $mode eq 's'){
push @slaves, split /\s+/,$tree->{slaves};
@@ -875,8 +880,8 @@ sub get_detail ($$$$;$){
my $probe = $cfg->{__probes}{$tree->{probe}};
my $ProbeDesc = $probe->ProbeDesc();
my $ProbeUnit = $probe->ProbeUnit();
- my $step = $probe->step();
my $pings = $probe->_pings($tree);
+ my $step = $probe->step();
my $page;
return "<div>ERROR: unknown displaymode $mode</div>"
@@ -1661,7 +1666,7 @@ sub update_rrds($$$$$$) {
next if defined $justthisprobe and $probe ne $justthisprobe;
my $probeobj = $probes->{$probe};
my $pings = $probeobj->_pings($tree);
- if ($prop eq 'host' and check_filter($cfg,$name)) {
+ if ($prop eq 'host' and check_filter($cfg,$name) and $tree->{$prop} !~ m|^/|) { # skip multihost
my %slave_test;
my $slaveupdates;
my @updates = ([ "", time, $probeobj->rrdupdate_string($tree) ]);