From 3809f4928c67b774515d0cbd6dfcbb0587ec4dd1 Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Wed, 23 Jan 2008 12:56:35 +0000 Subject: added new hide and noserverpoll properties to target configuration --- lib/Smokeping/Graphs.pm | 1 + lib/Smokeping/Master.pm | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/Smokeping') diff --git a/lib/Smokeping/Graphs.pm b/lib/Smokeping/Graphs.pm index 85ed2b7..8d13cbe 100644 --- a/lib/Smokeping/Graphs.pm +++ b/lib/Smokeping/Graphs.pm @@ -180,6 +180,7 @@ sub get_multi_detail ($$$$;$){ $i++; my $swidth = $max->{$start} / $cfg->{Presentation}{detail}{height}; my $rrd = $cfg->{General}{datadir}.$host.".rrd"; + next unless -r $rrd; # skip things that do not exist; my $medc = shift @colors; my @tree_path = split /\//,$host; shift @tree_path; diff --git a/lib/Smokeping/Master.pm b/lib/Smokeping/Master.pm index 4a5cd90..95c7884 100644 --- a/lib/Smokeping/Master.pm +++ b/lib/Smokeping/Master.pm @@ -46,7 +46,8 @@ sub get_targets { $ok = 1 if $key eq 'host'; $return{$key} = $trg->{$key}; } - } + } + $trg->{nomasterpoll} = 'no'; # slaves poll always return ($ok ? \%return : undef); } @@ -99,11 +100,9 @@ sub save_updates { for my $update (split /\n/, $updates){ my ($name, $time, $updatestring) = split /\t/, $update; my $file = $cfg->{General}{datadir}."/${name}.slave_cache"; - if ( ! -f $cfg->{General}{datadir}."/${name}.rrd" ){ + if ( ${name} =~ m{(^|/)\.\.($|/)} ){ warn "Skipping update for ${name}.slave_cache since ". - "$cfg->{General}{datadir}/${name}.rrd does not exist ". - " in the local data structure. Make sure you run the ". - "smokeping daemon. ($cfg->{General}{datadir})\n"; + "you seem to try todo some directory magic here. Don't!"; } elsif ( open (my $lock, '>>' , "$file.lock") ) { for (my $i = 10; $i > 0; $i--){ -- cgit v1.2.3-24-g4f1b