diff -ruN nagiosplug-save/contrib/check_snmp_procs.pl nagiosplug/contrib/check_snmp_procs.pl
--- nagiosplug-save/contrib/check_snmp_procs.pl	2004-02-17 13:23:31.000000000 +0000
+++ nagiosplug/contrib/check_snmp_procs.pl	2004-03-27 23:14:55.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -wT
 #
 # check_snmp_procs.pl
 #    Nagios script to check processes on remote host via snmp
@@ -32,33 +32,62 @@
 #    make it work with snmp version 3
 #    Suggestions???
 #
-#use strict;
-use Getopt::Long;
+
+require 5.004;
+use strict;
+use lib utils.pm ;
+use Plugin;
+use Plugin::Parameter qw(:DEFAULT :standard :snmp :thresholds $P_opt);
+
 use Net::SNMP qw (oid_lex_sort oid_base_match SNMP_VERSION_1);
-use lib utils.pm;
-use utils qw(%ERRORS &print_revision &support &usage);
 
-my $PROGNAME="check_snmp_procs";
-my $REVISION="1.0";
+use vars qw($opt_authprotocol $opt_authpassword $opt_community
+	    $opt_critical $opt_host $opt_oidname $opt_port $opt_privpassword
+	    $opt_regexp $opt_snmp_version $opt_timeout $opt_username
+	    $opt_verbose $opt_wanted_procs $opt_warning $opt_password $PROGNAME);
 
-#
-my $opt_authprotocol;
-my $opt_authpassword;
-my $opt_community    = 'ma4read';
-my $opt_critical;
-my $opt_help;
-my $opt_host         = 'euler';
-my $opt_oidname      = 'hrSWRunName';
-my $opt_port         = 161;
-my $opt_privpassword;
-my $opt_regexp       = 0;
-my $opt_snmp_version = '2c';
-my $opt_timeout      = $utils::TIMEOUT;
-my $opt_username;
-my $opt_verbose;
-my $opt_version;
-my $opt_wanted_procs;
-my $opt_warning;
+use utils qw(%ERRORS &print_revision &support &usage);
+
+my $a_opt = $authprotocolparameter;
+my $A_opt = $authpasswordparameter;
+my $S_opt = $snmpversionparameter;
+my $U_opt = $u_opt;
+
+$H_opt->binding(\$opt_host);
+my $N_opt = new Plugin::Parameter(-name => "names", -flags => [ 'N', 'names' ],
+				  -optional => "no", -valueoptional => "no", -type => "processname:[minimum],...",
+				  -binding => \$opt_wanted_procs,
+				  -description => "Process names to check, (optional) minimum number of processes");
+$a_opt->binding(\$opt_authprotocol);
+$A_opt->binding(\$opt_authpassword);
+$C_opt->binding(\$opt_community);
+$c_opt->binding(\$opt_critical);
+$c_opt->optional("yes");
+my $o_opt = new Plugin::Parameter(-name => "oidname", -flags => [ 'o', 'oidname' ],
+				  -optional => "yes", -valueoptional => "no", -type => "OIDNAME",
+				  -binding => \$opt_oidname,
+				  -default => "hrSWRunName",
+				  -description => "Which oid tree to search, hrSWRunName or hrSWRunPath");
+$P_opt->binding(\$opt_password);
+$P_opt->flags([ 'P', 'password' ]);
+$p_opt->binding(\$opt_port);
+$p_opt->default("snmp");
+my $r_opt = new Plugin::Parameter(-name => "regex", -flags => [ 'r', 'regexp' ],
+				  -optional => "yes", -valueoptional => "yes", -type => "NONE",
+				  -description => "Use regular expression match for <process>");
+$S_opt->binding(\$opt_snmp_version);
+$S_opt->default("snmpv2c");
+$t_opt->binding(\$opt_timeout);
+$U_opt->binding(\$opt_username);
+$v_opt->binding(\$opt_verbose);
+$w_opt->binding(\$opt_warning);
+$w_opt->optional("yes");
+my $plugin = new Plugin(-revision => '$Revision: 1.1 $',
+			-copyright => "2003 David Alden, 2004 Howard Wilkinson <howard\@cohtech.com>",
+			-shortcomment => "Check if processes are running on a host via snmp",
+			-longcomment => "A CRITICAL error will be indicated unless there are at least <minimum> number of processes running (unless <minimum> is set to 0 -- useful if you don't mind that there are none of the processes running).\n\nIf no processes are specified, the program will still connect to the remote host and download the current list of running processes.  It will then exit with an OK (unless it wasn't able to connect) -- useful if you want to make sure that the remote snmpd process is running and returning a list of procs.",
+			-parameterlists => [ [ $H_opt, $r_opt, $v_opt, $N_opt, $a_opt, $A_opt, $U_opt, $P_opt, $o_opt, $S_opt,
+					       $C_opt, $p_opt, $t_opt, $w_opt, $c_opt ], $h_opts, $V_opts ]);
 
 #
 my $max_no_processes = 999999;
@@ -68,10 +97,6 @@
 my $exit_status;
 
 #
-my @wanted_procs;
-my %current_process_list;
-
-#
 my %OIDS = (hrSWRunName => '1.3.6.1.2.1.25.4.2.1.2',
 	    hrSWRunPath => '1.3.6.1.2.1.25.4.2.1.4');
 
@@ -83,55 +108,13 @@
 $ENV{'BASH_ENV'}=''; 
 $ENV{'ENV'}='';
 
-#
-Getopt::Long::Configure('bundling');
-if (GetOptions(
-	"a:s" => \$opt_authprotocol,  "authprotocol:s"  => \$opt_authprotocol,
-	"A:s" => \$opt_authpassword,  "authpassword:s"  => \$opt_authpassword,
-	"C:s" => \$opt_community,     "community:s"     => \$opt_community,
-        "c:s" => \$opt_critical,      "critical:s"      => \$opt_critical,
-	"h"   => \$opt_help,          "help"	        => \$opt_help,
-	"H:s" => \$opt_host,          "hostname:s"      => \$opt_host,
-	"o:s" => \$opt_oidname,       "oidname:s"       => \$opt_oidname,
-	"P=s" => \$opt_password,      "password=s"      => \$opt_password,
-	"p=i" => \$opt_port,          "port=i"          => \$opt_port,
-	"r"   => \$opt_regexp,        "regexp"          => \$opt_regexp,
-	"S"   => \$opt_snmp_version,  "snmpversion"     => \$opt_snmp_version,
-	"t=i" => \$opt_timeout,       "timeout=i"       => \$opt_timeout,
-	"U=s" => \$opt_username,      "username=s"      => \$opt_username,
-	"v"   => \$opt_verbose,       "verbose"         => \$opt_verbose,
-	"V"   => \$opt_version,       "version"         => \$opt_version,
-	"N=s" => \$opt_wanted_procs,  "names=s"         => \$opt_wanted_procs,
-        "w:s" => \$opt_warning,       "warning:s"       => \$opt_warning)
-    == 0) {
-	print_usage();
-	exit $ERRORS{'UNKNOWN'};
-}
-
-if ($opt_version) {
-	print_revision($PROGNAME, "\$Revision: 1.1 $REVISION \$");
-	exit $ERRORS{'OK'};
-}
-
-if ($opt_help) {
-	print_help();
-	exit $ERRORS{'OK'};
-}
-
-if (! utils::is_hostname($opt_host)){
-	usage();
-	exit $ERRORS{'UNKNOWN'};
-}
+$plugin->init();
 
-($longest_wanted, @wanted_procs) = parse_wanted_procs($opt_verbose, $opt_wanted_procs, $opt_warning, $opt_critical);
+my ($longest_wanted, @wanted_procs) = parse_wanted_procs($opt_verbose, $opt_wanted_procs, $opt_warning, $opt_critical);
 
-$SIG{'ALRM'} = sub {
-	print "Timeout: No Answer from Client\n";
-	exit $ERRORS{'UNKNOWN'};
-};
-alarm($opt_timeout);
+$plugin->start_timeout($opt_timeout, "Timeout: No Answer from Client");
 
-($longest_current, %current_process_list) = get_process_list($opt_verbose, $opt_host, $opt_username, $opt_privpassword, $opt_authprotocol, $opt_authpassword, $opt_community, $opt_port, $opt_oidname, $opt_snmp_version);
+my ($longest_current, %current_process_list) = get_process_list($opt_verbose, $opt_host, $opt_username, $opt_privpassword, $opt_authprotocol, $opt_authpassword, $opt_community, $opt_port, $opt_oidname, $opt_snmp_version);
 
 $exit_status = compare_process_list($opt_regexp, \%current_process_list, @wanted_procs);
 
@@ -176,14 +159,14 @@
 		}
 	}
 
-	print "SNMPPROC ";
+	print "$PROGNAME ";
 
 	if ($#critical >= 0) {
 		print "CRITICAL:";
 	} elsif ($#warning >= 0) {
 		print "WARNING:";
 	} else {
-		print "OK";
+		print "OK:";
 	}
 
 	foreach $i (@critical) {
@@ -240,7 +223,7 @@
 
 	my($verbose, $host, $username, $privpassword, $authprotocol, $authpassword, $community, $port, $oidname, $snmp_version) = @_;
 	my(%process_list, %process_pid_list, $result);
-	my $process_list_longest = 1, $not_done = 1;
+	my ($process_list_longest, $not_done) = (1, 1);
 	my(@args, @oids, $oid, $name);
 
 	($session, $error) = Net::SNMP->session(
@@ -347,13 +330,13 @@
 
 	if( defined($warning) && $#process_array != $#warn_array ) {
 
-		print "Error: Number of entries in process list($#process_array) and warn list($#warn_array) don't match\n";
+		print "$PROGNAME UNKNOWN: Error: Number of entries in process list($#process_array) and warn list($#warn_array) don't match\n";
 		exit $ERRORS{'UNKNOWN'};
 	}
 
 	if( defined($critical) && $#process_array != $#critical_array ) {
 
-		print "Error: Number of entries in process list and critical list don't match\n";
+		print "$PROGNAME UNKNOWN Error: Number of entries in process list and critical list don't match\n";
 		exit $ERRORS{'UNKNOWN'};
 	}
 
@@ -509,82 +492,3 @@
 
 	return;
 }
-
-
-#
-sub print_usage {
-    print "Usage:
- $PROGNAME -H <host> [-r] [-v]
-		  -N <processname>[:minimum][,<processname>[:minimum] ...]
-		  [-a <authprotocol>] [-A <authpassword>]
-		  [-U <username>] [-P <password>]
-		  [-o <oidname>] [ -S <snmpversion> ]
-		  [-C <snmp_community>] [-p <port>] [-t <timeout>]
-		  [-w <low>:<high>[,<low>:<high> ...]
-		  [-c <low>:<high>[,<low>:<high> ...]
-       $PROGNAME (-h | --help) for detailed help
-       $PROGNAME (-V | --version) for version information\n";
-}
-
-
-#
-sub print_help {
-	print_revision($PROGNAME, "\$Revision: 1.1 $REVISION \$");
-	print "Copyright (c) 2003 David Alden
-
-Check if processes are running on a host via snmp
-
-";
-
-	print_usage();
-
-	print "
--a, --authprotocol=<authprotocol>
-   Set the authentication protocol used for authenticated SNMPv3 messages
--A, --authpassword=<authpassword>
-   Set the authentication pass phrase used for authenticated SNMPv3 messages
--c, --critical=<low>:<high>[,<low>:<high> ...]
-   exit with CRITICAL status if number of processes is between <low> and <high>
--C, --community=<snmp_community>
-   SNMP read community (default: $opt_community)
--h, --help
-   Show this help screen
--H, --host=<host>
-   Check processes on the indiciated host
--o, --oidname=<oidname>
-   Which oid tree to search, hrSWRunName or hrSWRunPath (default: $opt_oidname)
--p, --port=<port>
-   Make connection on the indicated port (default: $opt_port)
--N, --names=<processname>[:<minimum>][,<processname>[:<minimum>] ...]
-   Process names to check, (optional) minimum number of processes (default: 1)
--P, --password=<privpassword>
-   Set the privacy pass phrase used for encrypted SNMPv3 messages
--r, --regex
-   Use regular expression match for <process>
--S, --snmpversion
-   Use snmp version specified (values: 1|2c|3, default: $opt_snmp_version)
--t, --timeout
-   Plugin time out in seconds (default: $opt_timeout)
--U, --username=<securityname>
-   Set the securityname used for encrypted SNMPv3 messages
--v, --verbose
-   Print some extra debugging information (not advised for normal operation)
--V, --version
-   Show version and license information
--w, --warning=<low>:<high>[,<low>:<high> ...]
-   exit with WARNING status if number of processes is between <low> and <high>
-
-
-A CRITICAL error will be indicated unless there are at least <minimum> number
-of processes running (unless <minimum> is set to 0 -- useful if you don't
-mind that there are none of the processes running).
-
-If no processes are specified, the program will still connect to the remote
-host and download the current list of running processes.  It will then exit
-with an OK (unless it wasn't able to connect) -- useful if you want to make
-sure that the remote snmpd process is running and returning a list of procs.
-
-
-";
-	support();
-}
