X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=contrib%2Fmigrate-3-4.px;h=9fa11398efd78754a178834ece2b67cb5401637a;hb=d5272dbabf4c7a47f34066c05f479523d7b8beae;hp=cbbc179b8fb7f394e45f87037ccb78e55826d8d4;hpb=034a237b11bf1a8809751f103b01ff1c3859ec2b;p=collectd.git diff --git a/contrib/migrate-3-4.px b/contrib/migrate-3-4.px index cbbc179b..9fa11398 100755 --- a/contrib/migrate-3-4.px +++ b/contrib/migrate-3-4.px @@ -95,6 +95,7 @@ our %Subdirs = our %TypeTranslate = ( cpu => sub { $_ = shift; $_->{'plugin_instance'} = $_->{'type_instance'}; $_->{'type_instance'} = undef; $_; }, + hddtemp => sub { $_ = shift; $_->{'plugin'} = 'hddtemp'; $_->{'type'} = 'temperature'; $_->{'type_instance'} = $_->{'type_instance'}; $_; }, if_errors => sub { $_ = shift; $_->{'type_instance'} = $_->{'plugin_instance'}; $_->{'plugin_instance'} = undef; $_; }, if_packets => sub { $_ = shift; $_->{'type_instance'} = $_->{'plugin_instance'}; $_->{'plugin_instance'} = undef; $_; }, nfs2_procedures => sub { $_ = shift; @$_{qw(plugin plugin_instance type type_instance)} = ('nfs', 'v2' . $_->{'type_instance'}, 'nfs_procedure', undef); $_; }, @@ -125,7 +126,7 @@ our %TypeRename = GetOptions ("indir|i=s" => \$InDir, "outdir|o=s" => \$OutDir, - "hostname=s" => \$Hostname) or exit (1); + "hostname=s" => \$Hostname) or exit_usage (); die "No such directory: $InDir" if (!-d $InDir); @@ -374,3 +375,11 @@ sub special_disk $dest_filename = get_filename ($dest); print "./extractDS.px -i '$InDir/$orig_filename' -s 'rtime' -s 'wtime' -o '$OutDir/$dest_filename' -d 'read' -d 'write'\n"; } + +sub exit_usage +{ + print <