X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=contrib%2Fmigrate-4-5.px;h=c2a95558b236e96477e94884c0ab703ff4fd942a;hb=d6f0273b2ebae6995d69c7701838825b96e4f424;hp=d3ff796d3ed7d1139edacfebd638746bb8062c5d;hpb=26fbc23e518dcc74502ae3b2495112adc3840879;p=collectd.git diff --git a/contrib/migrate-4-5.px b/contrib/migrate-4-5.px index d3ff796d..c2a95558 100755 --- a/contrib/migrate-4-5.px +++ b/contrib/migrate-4-5.px @@ -33,6 +33,7 @@ use File::Basename ('dirname'); our $InDir = '/var/lib/collectd'; our $RRDtool = 'rrdtool'; +our $RRDFilter = 'rrd_filter.px'; our %TypesCounterToDerive = # {{{ ( @@ -184,7 +185,15 @@ sub handle_file # {{{ { my $dir = join ('/', @path); print "mkdir -p \"$dir/$plugin-$type_inst\"\n"; - print "mv \"$path\" \"$dir/$plugin-$type_inst/$type.rrd\"\n"; + if (($plugin eq 'df') and ($type eq 'df')) + { + print "$RRDFilter --infile=\"$path\" --outfile=\"$dir/$plugin-$type_inst/df_complex-free.rrd\" --map free:value\n"; + print "$RRDFilter --infile=\"$path\" --outfile=\"$dir/$plugin-$type_inst/df_complex-used.rrd\" --map used:value\n"; + } + else + { + print "mv \"$path\" \"$dir/$plugin-$type_inst/$type.rrd\"\n"; + } } } # }}} sub handle_file @@ -223,10 +232,12 @@ migrate-4-5.px [OPTIONS] Valid options are: - --indir