From 923cb59acf4245c851093b4fe465a62f97e1543d Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Tue, 28 Aug 2007 20:39:55 +0000 Subject: try to kill split warning --- lib/Smokeping.pm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 6691832..b3e5496 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -1662,15 +1662,19 @@ sub update_rrds($$$$$$) { my $probeobj = $probes->{$probe}; my $pings = $probeobj->_pings($tree); if ($prop eq 'host' and check_filter($cfg,$name)) { - my %slave_test = ( map { $_,1 } split(/\s+/, $tree->{slaves})); - my $slaveupdates = Smokeping::Master::get_slaveupdates($name); + my %slave_test; + my $slaveupdates; my @updates = ([ "", time, $probeobj->rrdupdate_string($tree) ]); - for my $slave (@{$slaveupdates}){ - if (not $slave_test{$slave->[0]}){ - warn "WARNING: skipping update for $slave->[0] since it is not configured for $name\n"; - next; + if ($tree->{slaves}){ + %slave_test = ( map { $_,1 } split(/\s+/, $tree->{slaves})); + $slaveupdates = Smokeping::Master::get_slaveupdates($name); + for my $slave (@{$slaveupdates}){ + if (not $slave_test{$slave->[0]}){ + warn "WARNING: skipping update for $slave->[0] since it is not configured for $name\n"; + next; + } + push @updates, $slave; } - push @updates, $slave; } for my $update (sort {$a->[1] <=> $b->[1]} @updates){ # make sure we put the updates in chronological order in my $s = $update->[0] ? "~".$update->[0] : ""; -- cgit v1.2.3-24-g4f1b