X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=contrib%2Fmigrate-4-5.px;h=c2a95558b236e96477e94884c0ab703ff4fd942a;hb=d6f0273b2ebae6995d69c7701838825b96e4f424;hp=1e54683ae0333848b26dbd9269678a0387de0590;hpb=6bd4bf7b21f84746010792b885b9b71791dccb79;p=collectd.git diff --git a/contrib/migrate-4-5.px b/contrib/migrate-4-5.px index 1e54683a..c2a95558 100755 --- a/contrib/migrate-4-5.px +++ b/contrib/migrate-4-5.px @@ -32,8 +32,8 @@ use Data::Dumper (); use File::Basename ('dirname'); our $InDir = '/var/lib/collectd'; -our $OutDir = '/tmp/collectd-5'; our $RRDtool = 'rrdtool'; +our $RRDFilter = 'rrd_filter.px'; our %TypesCounterToDerive = # {{{ ( @@ -46,7 +46,6 @@ our %TypesCounterToDerive = # {{{ connections => ["value"], cpu => ["value"], current => ["value"], - df => ["used", "free"], disk_merged => ["read", "write"], disk_octets => ["read", "write"], disk_ops => ["read", "write"], @@ -185,7 +184,16 @@ sub handle_file # {{{ && (!$plugin_inst) && ($type_inst)) { my $dir = join ('/', @path); - print "mv \"$path\" \"$dir/$plugin-$type_inst/$type.rrd\"\n"; + print "mkdir -p \"$dir/$plugin-$type_inst\"\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 @@ -224,22 +232,24 @@ migrate-4-5.px [OPTIONS] Valid options are: - --indir