X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=contrib%2Fmigrate-4-5.px;h=8e5a7ed44be9459cf69415e50f46664c483f8aa4;hp=d3ff796d3ed7d1139edacfebd638746bb8062c5d;hb=de407dd4e036f73e9bd4658af9d71f504fc11109;hpb=3dffa6fb50c66249fb3da7592c7a9385edb74677 diff --git a/contrib/migrate-4-5.px b/contrib/migrate-4-5.px index d3ff796d..8e5a7ed4 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 = # {{{ ( @@ -103,8 +104,6 @@ our %TypesCounterToDerive = # {{{ protocol_counter => ["value"], ps_cputime => ["user", "syst"], ps_pagefaults => ["minflt", "majflt"], - ps_code => ["value"], - ps_data => ["value"], serial_octets => ["rx", "tx"], swap_io => ["value"], virt_cpu_total => ["ns"], @@ -184,7 +183,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 +230,12 @@ migrate-4-5.px [OPTIONS] Valid options are: - --indir Source directory - Default: $InDir - --rrdtool Path to the RRDtool binary - Default: $RRDtool + --indir Source directory + Default: $InDir + --rrdtool Path to the RRDtool binary + Default: $RRDtool + --rrdfilter Path to the rrd_filter.px script + Default: $RRDFilter EOF exit (1); @@ -234,8 +243,11 @@ EOF GetOptions ("indir|i=s" => \$InDir, "rrdtool=s" => \$RRDtool, + "rrdfilter=s" => \$RRDFilter, "help|h" => \&exit_usage) or exit_usage (); +print "#!/bin/bash\n\n"; + scan_dir ($InDir); # vim: set sw=2 sts=2 et fdm=marker :