From 7cafb0469f7f9aa5635cde32d04ee5c6c50d7c82 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 12 Jul 2012 18:58:34 +0200 Subject: [PATCH] patches/: Added migrate-4-5-df.dpatch. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … fixing the migration of 'df' values in migrate-4-5.px; thanks to 'markuskaindl' for reporting this on IRC. --- debian/changelog | 8 ++++ debian/patches/00list | 1 + debian/patches/migrate-4-5-df.dpatch | 64 ++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100755 debian/patches/migrate-4-5-df.dpatch diff --git a/debian/changelog b/debian/changelog index 41a6610..23f2411 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +collectd (5.1.0-3) UNRELEASED; urgency=low + + * debian/patches/migrate-4-5-df.dpatch: + - Added patch to fix the migration of 'df' values in migrate-4-5.px; + thanks to 'markuskaindl' for reporting this on IRC. + + -- Sebastian Harl Thu, 12 Jul 2012 18:57:04 +0200 + collectd (5.1.0-2) unstable; urgency=low * debian/collectd-core.postinst: diff --git a/debian/patches/00list b/debian/patches/00list index 6321d1f..390f00f 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -2,3 +2,4 @@ rrd_filter_path.dpatch collection_conf_path.dpatch bts559801_plugin_find_fix.dpatch rtnl_dump_filter.dpatch +migrate-4-5-df.dpatch diff --git a/debian/patches/migrate-4-5-df.dpatch b/debian/patches/migrate-4-5-df.dpatch new file mode 100755 index 0000000..93e50ee --- /dev/null +++ b/debian/patches/migrate-4-5-df.dpatch @@ -0,0 +1,64 @@ +commit 605dab534eb2f0ee26446c157c9fdd2ad6e9427a +Author: Florian Forster +Date: Thu Jul 5 15:48:29 2012 +0200 + + contrib/migrate-4-5.px: Break up "df" RRD files into multiple files. + +diff --git a/contrib/migrate-4-5.px b/contrib/migrate-4-5.px +index d3ff796..c39b51b 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 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 +245,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 : -- 2.30.2