summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a8369b0)
raw | patch | inline | side by side (parent: a8369b0)
author | Florian Forster <octo@collectd.org> | |
Thu, 5 Jul 2012 13:48:29 +0000 (15:48 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 5 Jul 2012 13:48:29 +0000 (15:48 +0200) |
contrib/migrate-4-5.px | patch | blob | history |
diff --git a/contrib/migrate-4-5.px b/contrib/migrate-4-5.px
index d3ff796d3ed7d1139edacfebd638746bb8062c5d..c39b51b655bf249c229b513009667b7a7c5dc074 100755 (executable)
--- a/contrib/migrate-4-5.px
+++ b/contrib/migrate-4-5.px
our $InDir = '/var/lib/collectd';
our $RRDtool = 'rrdtool';
+our $RRDFilter = 'rrd_filter.px';
our %TypesCounterToDerive = # {{{
(
{
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
Valid options are:
- --indir <dir> Source directory
- Default: $InDir
- --rrdtool <path> Path to the RRDtool binary
- Default: $RRDtool
+ --indir <dir> Source directory
+ Default: $InDir
+ --rrdtool <path> Path to the RRDtool binary
+ Default: $RRDtool
+ --rrdfilter <path> Path to the rrd_filter.px script
+ Default: $RRDFilter
EOF
exit (1);
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 :