diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2007-08-30 11:43:28 +0200 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2007-08-30 11:43:28 +0200 |
commit | 371043ac25913355a7239ccbe35f341ab65d800a (patch) | |
tree | 2a4a1e0f594bf4926aa91c284d5c4c76b4eb5ff5 /lib | |
parent | 66e499975a20daf698545dcadd80a572a1df0eb9 (diff) | |
download | smokeping-371043ac25913355a7239ccbe35f341ab65d800a.tar.gz smokeping-371043ac25913355a7239ccbe35f341ab65d800a.tar.xz |
fixes after testing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Smokeping.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 3e66ce5..ab1ab5e 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -672,12 +672,12 @@ sub get_overview ($$$$){ keys %$tree) { my @slaves = (""); - if ($tree->{$prop}{slaves}){ - push @slaves, split /\s+/,$tree->{$prop}{slaves}; - } - elsif ($tree->{$prop}{host} =~ m|^/|){ # multi host syntax + if ($tree->{$prop}{host} =~ m|^/|){ # multi host syntax @slaves = split /\s+/, $tree->{$prop}{host}; } + elsif ($tree->{$prop}{slaves}){ + push @slaves, split /\s+/,$tree->{$prop}{slaves}; + } my @G; #Graph 'script' my $max = $cfg->{Presentation}{overview}{max_rtt} || "100000"; @@ -710,7 +710,7 @@ sub get_overview ($$$$){ $rrd = $cfg->{General}{datadir}.$dir.'/'.$prop.$s.'.rrd'; $medc = $slave ? $cfg->{Slaves}{$slave}{color} : ($cfg->{Presentation}{overview}{median_color} || shift @colors); if ($#slaves > 0){ - $label = sprintf("%-20s","median RTT from ".($slave ? $cfg->{Slaves}{$slave}{display_name} : $cfg->{General}{display_name} || hostname)); + $label = sprintf("%-25s","median RTT from ".($slave ? $cfg->{Slaves}{$slave}{display_name} : $cfg->{General}{display_name} || hostname)); } else { $label = "med RTT" @@ -868,7 +868,7 @@ sub get_detail ($$$$;$){ return "" unless $tree->{host}; my @dirs = @{$open}; - my $file = (split(/~/, pop @dirs))[0]; + my $file = $mode eq 'c' ? (split(/~/, pop @dirs))[0] : pop @dirs; my $dir = ""; return "<div>ERROR: ".(join ".", @dirs)." has no probe defined</div>" @@ -1395,7 +1395,7 @@ sub display_webpage($$){ title => $charts ? "" : $tree->{title}, remark => $charts ? "" : ($tree->{remark} || ''), - overview => $charts ? get_charts($cfg,$q,$open) : get_overview( $cfg,$q,$tree,$open ), + overview => $charts ? get_charts($cfg,$q,$open) : get_overview( $cfg,$q,$tree,$open), body => $charts ? "" : get_detail( $cfg,$q,$tree,$open_orig ), target_ip => $charts ? "" : ($tree->{host} || ''), owner => $cfg->{General}{owner}, |