summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-08-28 22:39:55 +0200
committerTobi Oetiker <tobi@oetiker.ch>2007-08-28 22:39:55 +0200
commit923cb59acf4245c851093b4fe465a62f97e1543d (patch)
treec14b9b83fdc0a4fe1de549053ca9d75da37e7adf
parent25e6ce94b50e5f2fdc9e0c4d708d5660083c4a71 (diff)
downloadsmokeping-923cb59acf4245c851093b4fe465a62f97e1543d.tar.gz
smokeping-923cb59acf4245c851093b4fe465a62f97e1543d.tar.xz
try to kill split warning
-rw-r--r--lib/Smokeping.pm18
1 files 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] : "";