diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2008-03-18 00:18:05 +0100 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2008-03-18 00:18:05 +0100 |
commit | fdf500019c8c0a7a589c54f78ff0b9a293790e84 (patch) | |
tree | 1443744080e61b9aff50a91d51b25706b380dd55 | |
parent | 340239dd0fdf7e8a63ebaae809e548df3cda105b (diff) | |
download | smokeping-fdf500019c8c0a7a589c54f78ff0b9a293790e84.tar.gz smokeping-fdf500019c8c0a7a589c54f78ff0b9a293790e84.tar.xz |
just to be on the save side, make sure when loading the sortercache that we only load info about graphs presently in the config. --tobi
-rw-r--r-- | lib/Smokeping.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 36977d9..84775eb 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -1467,8 +1467,19 @@ sub load_sortercache($){ } my $data = Storable::retrieve("$_"); for my $chart (keys %$data){ + PATH: for my $path (keys %{$data->{$chart}}){ warn "Warning: Duplicate entry $chart/$path in sortercache\n" if defined $cache{$chart}{$path}; + my $root = $cfg->{Targets}; + for my $element (split /\//, $path){ + if (ref $root eq 'HASH' and defined $root->{$element}){ + $root = $root->{$element} + } + else { + warn "Warning: Dropping $chart/$path from sortercache\n"; + next PATH; + } + } $cache{$chart}{$path} = $data->{$chart}{$path} } } |