diff -ruN nagiosplug-save/contrib/check_dl_size.pl nagiosplug/contrib/check_dl_size.pl
--- nagiosplug-save/contrib/check_dl_size.pl	2002-04-07 06:13:57.000000000 +0100
+++ nagiosplug/contrib/check_dl_size.pl	2004-03-27 21:56:32.000000000 +0000
@@ -12,137 +12,91 @@
 # Last Updated: 8/31/01
 
 
-BEGIN {
-	if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
-		$runtimedir = $1;
-		$PROGNAME = $2;
-	}
-}
-
 require 5.004;
 use strict;
-use Getopt::Long;
-use vars qw($opt_H $opt_f $opt_s $opt_t $verbose $PROGNAME);
-use lib $main::runtimedir;
-use utils qw($TIMEOUT %ERRORS &print_revision &usage &support &is_error);
+use lib utils.pm ;
+use Plugin;
+use Plugin::Parameter qw($helpparameterlist $versionparameterlist $hostnameparameter
+			 $directoryparameter $filenameparameter $filesizeparameter
+			 $userparameter $passwordparameter
+			 $timeoutparameter $verboseparameter);
+
+use vars qw($opt_H $opt_f $opt_s $opt_t $opt_d $opt_u $opt_p $opt_v $PROGNAME);
+
+use utils qw(%ERRORS &usage);
 use Net::FTP;
 
-sub help ();
-sub print_help ();
-sub print_usage ();
-sub version ();
 sub display_res($$);
-my ($ftpfile, $ftpdir, $filesize, $answer) = ();
-my $state = $ERRORS{'UNKNOWN'};
 
-# Directory to place file. If your machine is not secure DO NOT USE /tmp.
-my $dir = "/usr/local/netsaint/etc/tmp";
+$directoryparameter->description("Directory to receive download file - don't use /tmp or /var/tmp");
+$userparameter->default("anonymous");
+$passwordparameter->default("nagios.filecheck\@example.com");
+$timeoutparameter->default(120);
+
+my @commandparameterlist = ( $hostnameparameter,
+			     $filenameparameter,
+			     $directoryparameter,
+			     $filesizeparameter,
+			     $userparameter,
+			     $passwordparameter,
+			     $timeoutparameter,
+			     $verboseparameter );
+
+my $plugin = new Plugin(-revision => '$Revision: 1.1 $',
+			-copyright => " 2001 Patrick Greenwell, Stealthgeeks, LLC, 2004 Howard Wilkinson <howard\@cohtech.com>",
+			-shortcomment => "Download a file using FTP and check its size",
+			-parameterlists => [ \@commandparameterlist, $helpparameterlist, $versionparameterlist ]);
 
-# Username for login
-my $user = "anonymous";
+$plugin->init();
 
-# Password (PLEASE TAKE APPROPRIATE PRECAUTIONS TO SECURE THIS)
-my $pass = "guest\@example.com";
+my ($ftpfile, $ftpdir, $filesize) = ();
 
+my $state = $ERRORS{'UNKNOWN'};
 
 delete @ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
 
-Getopt::Long::Configure('bundling', 'no_ignore_case');
-GetOptions
-	("V|version"    => \&version,
-	 "h|help"       => \&help,
-	 "v|verbose"    => \$verbose,
-	 "H|hostname=s" => \$opt_H,
-         "f|filename=s" => \$opt_f,
-         "s|filesize=s" => \$opt_s,
-         "t|timeout=s"  => \$opt_t,
-         );
-
-($opt_H) || ($opt_H = shift) || usage("Host address or name not specified\n");
-my $host = $1 
-        if ($opt_H =~ m/^(([0-9]{1,3}\.){3}[0-9]{1,3}|(([a-z0-9]+(\-+[a-z0-9]+)*|\.))+[a-z])$/i); 
-	usage("Please provide a valid IP address or host name\n") unless ($host);
-
-($opt_f) || ($opt_f = shift) || usage("File name not specified\n");
-
-if ($opt_f =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
-        $ftpdir = $1;
-        $ftpfile = $2;
-}
-
-($opt_s) || ($opt_s = shift) || usage("File size not specified\n");
-usage("File size must be numeric value") unless ($opt_s =~ m/^[0-9]+$/);
-
-(($opt_t) && ($TIMEOUT = $opt_t)) || ($TIMEOUT = 120);
-usage("TIMEOUT must be numeric value") unless ($TIMEOUT =~ m/^[0-9]+$/);
-
-# Don't hang if there are timeout issues
-$SIG{'ALRM'} = sub {
-	print ("ERROR: No response from ftp server (alarm)\n");
-	exit $ERRORS{'UNKNOWN'};
-};
-alarm($TIMEOUT);
+$opt_f =~ m/^(.*?)[\/\\]([^\/\\]+)$/;
+$ftpdir = $1;
+$ftpfile = $2;
 
 # Make certain temporary directory exists
-
-if ( ! -e "$dir" ) {
-        display_res("Temporary directory $dir does not exist.\n", "CRITICAL");
-
+if ( ! -e "$opt_d" ) {
+  display_res("Temporary directory $opt_d does not exist.", "CRITICAL");
 }
 
 # Remove existing file if any
-
-if ( -e "$dir/$ftpfile") {
-          unlink "$dir/$ftpfile"  or 
-          display_res("Can't remove existing file $dir/$ftpfile.\n", "CRITICAL");
+if ( -e "$opt_d/$ftpfile") {
+  unlink "$opt_d/$ftpfile"
+    or display_res("Can't remove existing file $opt_d/$ftpfile.", "CRITICAL");
 }
-    
+
 # Snarf file
+$plugin->start_timeout($opt_t, "No response from ftp server (alarm)");
 
-my $ftp = Net::FTP->new("$host", Passive => 1, Timeout => $TIMEOUT) or
-          display_res("Can't connect to $host.\n", "CRITICAL");
-          $ftp->login("$user","$pass") or 
-                  display_res("Login to $host failed", "CRITICAL");
-          $ftp->cwd("$ftpdir") or 
-                  display_res("Can't change to directory $ftpdir.\n", "CRITICAL");
-          $ftp->get($ftpfile, "$dir/$ftpfile") or 
-                  display_res("Can't retrieve file $ftpfile.\n", "CRITICAL");
-          $ftp->quit;
+my $ftp = Net::FTP->new("$opt_H", Passive => 1, Timeout => $opt_t)
+  or display_res("Can't connect to $opt_H.\n", "CRITICAL");
+$ftp->login("$opt_u","$opt_p")
+  or display_res("Login to $opt_H failed", "CRITICAL");
+$ftp->cwd("$ftpdir")
+  or display_res("Can't change to directory $ftpdir.", "CRITICAL");
+$ftp->get($ftpfile, "$opt_d/$ftpfile")
+  or display_res("Can't retrieve file $ftpfile.", "CRITICAL");
+$ftp->quit;
 
-# If file exists and is correct size we are happy.
+$plugin->stop_timeout();
 
-if (( -e "$dir/$ftpfile" ) && (($filesize = -s "/tmp/$ftpfile") eq $opt_s)) {
-        display_res("File $ftpfile size OK: $filesize bytes.\n", "OK");        
-        } else {
-# Otherwise we are not happy.
-        display_res("File $ftpfile size incorrect: $filesize bytes", "CRITICAL");
+# If file exists and is correct size we are happy.
+if (( -e "$opt_d/$ftpfile" ) && (($filesize = -s "$opt_d/$ftpfile") eq $opt_s)) {
+  display_res("File $ftpfile size OK: $filesize bytes.", "OK");        
+} else {
+  # Otherwise we are not happy.
+  display_res("File $ftpfile size incorrect: $filesize bytes", "CRITICAL");
 }
 
 exit;
 
-sub print_usage () {
-	print "Usage: $PROGNAME -H <host> -f <filename> -s <file size in bytes> -t <timeout> \n";
-}
-
-sub print_help () {
-	print_revision($PROGNAME,'$ Revision: 1.0 $ ');
-	print "Copyright (c) 2001 Patrick Greenwell, Stealthgeeks, LLC.\n\n";
-	print_usage();
-	support();
-}
-
-sub version () {
-	print_revision($PROGNAME,'$ Revision: 1.0 $ ');
-	exit $ERRORS{'OK'};
-}
-
-sub help () {
-	print_help();
-	exit $ERRORS{'OK'};
-}
-
 sub display_res ($$) {
-        my ($answer, $state) = @_;
-        print $answer;
-        exit $ERRORS{$state};
+  my ($answer, $state) = @_;
+  print "$PROGNAME $state: $answer\n";;
+  exit $ERRORS{$state};
 }
