diff -ruN nagiosplug-save/contrib/check_oracle_instance.pl nagiosplug/contrib/check_oracle_instance.pl
--- nagiosplug-save/contrib/check_oracle_instance.pl	2002-04-03 03:58:47.000000000 +0100
+++ nagiosplug/contrib/check_oracle_instance.pl	2004-03-27 22:51:36.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -wT
 # $Id: check_oracle_instance.pl,v 1.1 2002/04/03 02:58:47 sghosh Exp $
 
 #  Copyright (c) 2002  Sven Dolderer
@@ -12,41 +12,71 @@
 
 #   This software is provided without warranty of any kind.
 
-require 5.003;
-
+require 5.004;
 use strict;
-use Getopt::Long;
+use lib utils.pm ;
+use Plugin;
+use Plugin::Parameter qw(:DEFAULT $u_opt $P_opt);
+
+use vars qw($VERSION $PROGNAME $logfile $debug $state $dbh $database $username $password $message $sql $cursor $opt_asession $opt_nsession $opt_tablespace $opt_nextents $opt_fextents $opt_aextents $privsok $warn $critical);
+
+use utils qw(%ERRORS);
 
 # We need the DBI and DBD-Oracle Perl modules:
-require DBI || die "It appears that the DBI module is not installed! aborting...\n";
+use DBI;
 require DBD::Oracle || die "It appears that the DBD::Oracle module is not installed! aborting...\n";
 
-use vars qw($VERSION $PROGNAME $logfile $debug $state $dbh $database $username $password $message $sql $cursor $opt_asession $opt_nsession $opt_tablespace $opt_nextents $opt_fextents $opt_aextents $privsok $warn $critical);
+$u_opt->binding(\$username);
+$u_opt->optional("no");
+$P_opt->binding(\$password);
+$P_opt->flags([ 'p', 'password' ]);
+$P_opt->optional("no");
+my $c_opt = new Plugin::Parameter(-name => "connect", -flags => [ 'c', 'connect' ],
+				  -optional => "no", -valueoptional => "no", -type => "CONNECTSTRING",
+				  -binding => \$database,
+				  -description => "The oracle connect string as defined in tnsnames.ora");
+my $a_opt = new Plugin::Parameter(-name => "activesessions", -flags => [ 'a', 'active-session' ],
+				  -optional=> "yes", -valueoptional => "no", -type => "WARN/CRITICAL",
+				  -binding => \$opt_asession,
+				  -description => "check the number of active (user-)sessions, WARN(Integer): number of sessions to result in wanring status, CRITICAL(Integer): number of sessions to result in critical status");
+my $s_opt = new Plugin::Parameter(-name => "sessionnumber", -flags => [ 's', 'num-sessions' ],
+				  -optional => "yes", -valueoptional => "no", -type => "WARN/CRITICAL",
+				  -binding => \$opt_nsession,
+				  -description => "check the total number of (user-)sessions, WARN(Integer): number of sessions to result in warning status, CRITICAL(Integer): number of sessions to result in critical status");
+my $tab_opt = new Plugin::Parameter(-name => "tablespaces", -flags => [ 't', 'tablespaces' ],
+				    -optional => "yes", -valueoptional => "no", -type => "WARN/CRITICAL",
+				    -binding => \$opt_tablespace,
+				    -description => "check the percent of used space in every tablespace, WARN(Integer): percentage to result in warning status, CRITICAL(Integer): percentage to result in critical status");
+my $n_opt = new Plugin::Parameter(-name => "numextents", -flags => [ 'n', 'num-extents' ],
+				  -optional => "yes", -valueoptional => "no", -type => "WARN/CRITICAL",
+				  -binding => \$opt_nextents,
+				  -description => "check the number of extents of every object (excluding SYS schema), WARN(Integer): number of extents to result in warning status, CRITICAL(Integer): number of extents to result in critical status");
+my $f_opt = new Plugin::Parameter(-name => "freeextents", -flags => [ 'f', 'free-extents' ],
+				  -optional => "yes", -valueoptional => "no", -type => "WARN/CRITICAL",
+				  -binding => \$opt_fextents,
+				  -description => "check the number of free extents of every object: max_extents - #extents, WARN(Integer): number of free extents to result in warning status, CRITICAL(Integer): number of free extents to result in critical status");
+my $x_opt = new Plugin::Parameter(-name => "alloocateextents", -flags => [ 'x', 'allocate-extents' ],
+				  -optional => "yes", -valueoptional => "yes", -type => "NONE",
+				  -binding => \$opt_aextents,
+				  -description => "warn if an object cannot allocate a next extent.");
+$t_opt->flags([ 'T', 'timeout' ]);
+my $d_opt = new Plugin::Parameter(-name => "debug", -flags => [ 'd', 'debug' ],
+				  -optional => "yes", -valueoptional => "yes", -type => "NONE",
+				  -binding => \$debug,
+				  -description => "Write a debugging log file");
+my $l_opt = new Plugin::Parameter(-name => "logfile", -flags => [ 'l', 'log-file' ],
+				  -optional => "yes", -valueoptional => "no", -type => "FILENAME",
+				  -default => "/tmp/check_oracle_instance.log",
+				  -binding => \$logfile,
+				  -description => "Logfile for command - debug output mainly");
+my $plugin = new Plugin(-revision => '$Revision: 1.1 $',
+			-copyright => "2002 Sven Dolderer, 2004 Howard Wilkinson <howard\@cohtech.com>",
+			-shortcomment => "This plugin will check an oracle database instance. Prerequisties are: a local oracle client, Perl >= v5.004, and DBI and DBD::Oracle perl modules.",
+			-parameterlists => [ [ $u_opt, $P_opt, $c_opt, $a_opt, $s_opt, $tab_opt, $n_opt, $f_opt, $x_opt, $t_opt, $d_opt, $l_opt ], $h_opts, $V_opts ]);
+
+
+$plugin->init();
 
-'$Revision: 1.1 $' =~ /^.*(\d+.\d+) \$$/;  # Use The Revision from RCS/CVS
-$VERSION = $1;
-$0 =~ m!^.*/([^/]+)$!;
-$PROGNAME = $1;
-#$debug="true";
-$logfile = "/tmp/check_oracle_instance.log";
-my %ERRORS = (UNKNOWN => -1, OK => 0, WARNING => 1, CRITICAL => 2);
-
-# Read cmdline opts:
-Getopt::Long::Configure('bundling', 'no_ignore_case');
-GetOptions (
-         "V|version"    => \&version,
-         "h|help"       => \&usage,
-         "u|user=s" => \$username,
-         "p|passwd=s" => \$password,
-         "c|connect=s" => \$database,
-         "a|active-sessions:s"  => \$opt_asession,
-         "s|num-sessions:s"  => \$opt_nsession,
-         "t|tablespaces:s" => \$opt_tablespace,
-         "n|num-extents:s" => \$opt_nextents,
-         "f|free-extents:s" => \$opt_fextents,
-         "x|allocate-extents" => \$opt_aextents
-        );
-($database && $username && $password) || die "mandatory parameters missing (try -h)\n";
 logit("    \$opt_asession = \"$opt_asession\"");
 logit("    \$opt_nsession = \"$opt_nsession\"");
 logit("    \$opt_tablespace = \"$opt_tablespace\"");
@@ -70,71 +100,6 @@
 exit $state;
 
 
-sub usage {
-   copyright();
-   print "
-This plugin will check various things of an oracle database instance.
-
-Prerequisties are: a local oracle client,
-                   perl > v5.003, and DBI and DBD::Oracle perl modules.
-
-Usage: $PROGNAME -u <user> -p <passwd> -c <connectstring>
-          [-a <w>/<c>] [-s <w>/<c>] [-t <w>/<c>] [-n <w>/<c>] [-f <w>/<c>] [-x]
-       $PROGNAME [-V|--version]
-       $PROGNAME [-h|--help]
-";
-   print "
-Options:
- -u, --user=STRING
-    the oracle user
- -p, --passwd=STRING
-    the oracle password
- -c, --connect=STRING
-    the oracle connectstring as defined in tnsnames.ora
- -a, --active-sessions=WARN/CRITICAL
-    check the number of active (user-)sessions
-      WARN(Integer): number of sessions to result in warning status,
-      CRITICAL(Integer): number of sessions to result in critical status
- -s, --num-sessions=WARN/CRITICAL
-    check the total number of (user-)sessions
-      WARN(Integer): number of sessions to result in warning status,
-      CRITICAL(Integer): number of sessions to result in critical status
- -t, --tablespaces=WARN/CRITICAL
-    check the percent of used space in every tablespace
-      WARN(Integer): percentage to result in warning status,
-      CRITICAL(Integer): percentage to result in critical status
- -n, --num-extents=WARN/CRITICAL
-    check the number of extents of every object (excluding SYS schema)
-      WARN(Integer): number of extents to result in warning status,
-      CRITICAL(Integer): number of extents to result in critical status
- -f, --free-extents=WARN/CRITICAL
-    check the number of free extents of every object: max_extents - #extents
-      WARN(Integer): number of free extents to result in warning status,
-      CRITICAL(Integer): number of free extents to result in critical status
- -x, --allocate-extents
-    warn if an object cannot allocate a next extent.
-";
-   exit $ERRORS{"UNKNOWN"};
-}
-
-
-sub version {
-   copyright();
-   print "
-$PROGNAME $VERSION
-";
-   exit $ERRORS{"UNKNOWN"};
-}
-
-
-sub copyright {
-   print "The netsaint plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
-copies of the plugins under the terms of the GNU General Public License.
-For more information about these matters, see the file named COPYING.
-Copyright (c) 2002 Sven Dolderer\n";
-}
-
-
 sub logit {
    my $text = shift;
    if ($debug) {
