diff -ruN nagiosplug-save/contrib/check_ftpget.pl nagiosplug/contrib/check_ftpget.pl
--- nagiosplug-save/contrib/check_ftpget.pl	2002-02-28 06:42:53.000000000 +0000
+++ nagiosplug/contrib/check_ftpget.pl	2004-03-27 22:07:45.000000000 +0000
@@ -1,48 +1,71 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -wT
 ## Written 12/5/00 Jeremy Hanmer 
 # $Id: check_ftpget.pl,v 1.1.1.1 2002/02/28 06:42:53 egalstad Exp $
 
+require 5.004;
 use strict;
+use lib utils.pm ;
+use Plugin;
+use Plugin::Parameter qw($helpparameterlist $versionparameterlist $hostnameparameter $userparameter
+			 $passwordparameter $filenameparameter $directoryparameter
+			 $timeoutparameter $verboseparameter);
+
 use Net::FTP;
-use Getopt::Std;
 
-use vars qw($opt_H $opt_u $opt_p $opt_f);
-getopts("H:u:p:f:");
+use vars qw($opt_H $opt_u $opt_p $opt_f $opt_d $opt_t $opt_v $PROGNAME);
+
+use utils qw(%ERRORS &usage);
 
-my $host = $opt_H || 
-    die "usage: check_ftp.pl -h host [<-u user> <-p pass> <-f file>]\n";
+$userparameter->default('anonymous');
+$passwordparameter->default("$ENV{'LOGNAME'}\@$ENV{'HOSTNAME'}");
+$filenameparameter->optional("yes");
+$directoryparameter->default("/var/tmp/nagios");
+$directoryparameter->optional("yes");
+my $plugin = new Plugin(-revision => '$Revision: 1.1.1.1',
+			-copyright => "2000 Jeremy Hanmer, 2004 Howard Wilkinson <howard\@cohtech.com>",
+			-shortcomment => "Retrieve a file using FTP",
+			-parameterlists => [ [ $hostnameparameter,
+					       $userparameter,
+					       $passwordparameter,
+					       $filenameparameter,
+					       $directoryparameter,
+					       $timeoutparameter,
+					       $verboseparameter ],
+					     $helpparameterlist,
+					     $versionparameterlist ]);
 
-my $username = $opt_u || 'anonymous';
-my $pass = $opt_p || "$ENV{'LOGNAME'}\@$ENV{'HOSTNAME'}" ;
+$plugin->init();
 
-my $file = $opt_f;
+$plugin->start_timeout($opt_t, "FTP request timed out");
 
-my $status = 0;
-my $problem;
+my $status = 'OK';
 my $output = "ftp ok";
 
-my $ftp = Net::FTP->new("$host") ||
-    &crit("connect");
+my $ftp = Net::FTP->new("$opt_H") || &crit("connect");
 
-$ftp->login("$username", "$pass") ||
-    &crit("login");
+$ftp->login("$opt_u", "$opt_p") || &crit("login");
 
-$ftp->get($file) ||
-    &crit("get") if $file;
+if ($opt_f) {
+  if (! -d $opt_d) {
+    mkdir $opt_d;
+  }
+  chdir $opt_d;
+  $ftp->get($opt_f, "$$.tmp") || &crit("get");
+}
+
+print "$PROGNAME $status: $output\n";
+exit $ERRORS{$status};
 
 sub crit() 
 {
-    $problem = $_[0];
-    $status = 2;
-    if ( $problem eq 'connect' ) {
-        $output = "can't connect";
-    } elsif ( $problem eq 'login' ) {
-        $output = "can't log in";
-    } elsif ( $problem eq 'get' ) {
-        $output = "cant get $file";
-    }
+  my $problem = $_[0];
+  $status = 'CRITICAL';
+  if ( $problem eq 'connect' ) {
+    $output = "can't connect";
+  } elsif ( $problem eq 'login' ) {
+    $output = "can't log in";
+  } elsif ( $problem eq 'get' ) {
+    $output = "can't get $opt_f";
+  }
 }
 
-print "$output\n";
-exit $status;
-
