diff -ruN nagiosplug-save/contrib/check_backup.pl nagiosplug/contrib/check_backup.pl
--- nagiosplug-save/contrib/check_backup.pl	2002-04-07 06:13:57.000000000 +0100
+++ nagiosplug/contrib/check_backup.pl	2004-03-27 21:31:01.000000000 +0000
@@ -11,104 +11,77 @@
 # Version 1.0
 # Last Updated: 9/12/01
 
-
-BEGIN {
-	if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
-		$runtimedir = $1;
-		$PROGNAME = $2;
-	}
-}
-
 require 5.004;
 use strict;
-use Getopt::Long;
-use vars qw($opt_H $opt_d $opt_s $opt_t $verbose $PROGNAME);
+use lib utils.pm ;
+use Plugin;
+use Plugin::Parameter qw ($helpparameterlist $versionparameterlist $timeoutparameter
+			  $directoryparameter $verboseparameter);
+use vars qw($opt_d $opt_s $opt_t $opt_h $xml $opt_v $opt_a $PROGNAME);
 use lib $main::runtimedir;
-use utils qw($TIMEOUT %ERRORS &print_revision &usage &support &is_error);
+use utils qw(%ERRORS &usage);
+
+$timeoutparameter->default(120);
+my $minsizeparameter = new Plugin::Parameter(-name => "minsize", -flags => [ 's', 'minsize' ],
+					     -optional => "yes", -valueoptional => 0, -type => "INTEGER",
+					     -default => 40000000,
+					     -checker => \&Plugin::Parameter::_check_integer,
+					     -description => "Minimum file size" );
+my $fileageparameter = new Plugin::Parameter(-name => "fileage", -flags => [ 'a', 'fileage' ],
+					     -optional => "yes", -valueoptional => 0, -type => "SECONDS",
+					     -default => 3600,
+					     -checker => \&Plugin::Parameter::_check_time,
+					     -description => "Maximum age of files to be checked");
+my @commandparameterlist = ( $directoryparameter,
+			     $minsizeparameter,
+			     $fileageparameter,
+			     $timeoutparameter,
+			     $verboseparameter );
+
+my $plugin = new Plugin(-revision => '$Revision: 1.0 $',
+			-copyright => "2001 Patrick Greenwell, Stealthgeeks, LLC. <patrick\@stealthgeeks.net>, 2004 Howard Wilkinson <howard\@cohtech.com>",
+			-shortcomment => "Checks a directory to see if at least one file was created within a specified period of time that is of equal to or greater than a given size.",
+			-parameterlists => [ \@commandparameterlist, $helpparameterlist, $versionparameterlist ] );
+
 
-sub help ();
-sub print_help ();
-sub print_usage ();
-sub version ();
 sub display_res($$);
 my ($filesize, $answer) = ();
 my $state = $ERRORS{'UNKNOWN'};
 
-# Directory to check.
-my $dir = "/backup/";
-
 # Time period(in seconds)
 my $within = "3600";
 
-# Minimum size of file (in bytes)
-my $minsize = "40000000";
-
 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,
-         "d|directory=s" => \$opt_d,
-         "s|minsize=s"   => \$opt_s,
-         "t|timeout=s"   => \$opt_t,
-         );
-
-($opt_s) || ($opt_s = shift) || usage("Minimum 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);
+$plugin->init();
+
+$plugin->start_timeout($opt_t, "No response from file system request");
 
 # Do stuff
 
-my $time = time;
- 
-opendir(THISDIR, "$dir") or die "Can't open directory! $!";
+my $time = time();
+
+opendir(THISDIR, "$opt_d") or die "Can't open directory! $!";
 my @allfiles = grep !/^\./, readdir THISDIR;
 closedir THISDIR;
-while (my $file = $dir . pop @allfiles){
-        my ($size, $mtime) = (stat($file))[7,9];
-        if  (((my $a = ($time - $mtime)) <= $within) and ($size >= $opt_s)){
-                display_res("OK: File $file is <= $within and >=$opt_s bytes.\n","OK");        
-        }
-}
- 
-# If we got here nothing matched.... 
-display_res("CRITICAL: No files in $dir are <= $within and >= $minsize.", "CRITICAL");
 
-exit;
-
-sub print_usage () {
-	print "Usage: $PROGNAME -s <minimum file size in bytes> -t <timeout> \n";
-}
+$plugin->stop_timeout();
 
-sub print_help () {
-	print_revision($PROGNAME,'$ Revision: 1.0 $ ');
-	print_usage();
-	support();
+while (@allfiles){
+  my $file = $opt_d . '/' . pop @allfiles;
+  my ($size, $mtime) = (stat($file))[7,9];
+  if ((($time - $mtime) <= $opt_a) and ($size >= $opt_s)) {
+    display_res("File $file is <= $opt_a seconds old and >= $opt_s bytes.\n", "OK");
+  }
 }
 
-sub version () {
-	print_revision($PROGNAME,'$ Revision: 1.0 $ ');
-	exit $ERRORS{'OK'};
-}
+# If we got here nothing matched.... 
+display_res("No files in $opt_d are <= $opt_a seconds old and >= $opt_s bytes.", "CRITICAL");
 
-sub help () {
-	print_help();
-	exit $ERRORS{'OK'};
-}
+exit;
 
 sub display_res ($$) {
-        my ($answer, $state) = @_;
-        print $answer;
-        exit $ERRORS{$state};
+  my ($answer, $state) = @_;
+  printf "%s %s: %s", $PROGNAME, $state, $answer;
+  exit $ERRORS{$state};
 }
