diff -ruN nagiosplug-save/contrib/check_snmp_printer.pl nagiosplug/contrib/check_snmp_printer.pl
--- nagiosplug-save/contrib/check_snmp_printer.pl	2004-01-18 20:07:01.000000000 +0000
+++ nagiosplug/contrib/check_snmp_printer.pl	2004-03-27 23:12:11.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl -wT
 
 # check_snmp_printer - check for printer status via snmp
 #  Supports both standard PRINT-MIB (RFC-1759) and HP Enterprise print-mib
@@ -78,16 +78,44 @@
 #
 #  
 #
+
+require 5.004;
 use strict;
-use Getopt::Long;
-use vars qw($opt_V $opt_h $opt_H $opt_P $opt_t $opt_d $session $error $answer $key
-   $response $PROGNAME $port $hostname );
-use lib  "utils.pm";
-use utils qw(%ERRORS &print_revision &support &usage );
+use lib utils.pm ;
+use Plugin;
+use Plugin::Parameter qw(:DEFAULT :snmp);
+
+use vars qw($opt_H $opt_P $opt_t $opt_d $community $snmp_version $port $ptype
+	    $session $error $answer $key $response $PROGNAME $hostname );
+
+use utils qw(%ERRORS &usage );
+
 use Net::SNMP;
 
-sub print_help ();
-sub print_usage ();
+my $P_opt = new Plugin::Parameter(-name => "printer", -flags => [ 'P', 'printer' ],
+				  -optional => "yes", -valueoptional => "no", -type => "PRINTERTYPE",
+				  -default => "RFC",
+				  -checker => sub { my ($opt, $parameter, $plugin) = @_;
+						    if (defined $$opt && $$opt !~ m/^(RFC|HP)/i) {
+						      $plugin->usage();
+						      usage("$PROGNAME UNKNOWN: Printer type $$opt has not been implemented\n");
+						    }
+						  },
+				  -description => "Select type of printer to query - supported values are \"HP\" for Jetdirect printers and \"RFC\" for RFC 1759 Print MIB based implementations");
+my $v_opt = $snmpversionparameter;
+my $d_opt = new Plugin::Parameter(-name => "debug", -flags => [ 'd', 'debug' ],
+				  -optional => "yes", -valueoptional => "yes", -type => "NONE",
+				  -description => "Debug output");
+$v_opt->flags([ 'v', 'snmp_version' ]);
+$v_opt->binding(\$snmp_version);
+$C_opt->binding(\$community);
+$p_opt->default(161);
+$p_opt->binding(\$port);
+$H_opt->binding(\$hostname);
+my $plugin = new Plugin(-revision => '$Revision: 1.1 $',
+			-copyright => "2002 Subhendu Ghosh/Ethan Galstad, 2004 Howard Wilkinson <howard\@cohtech.com>",
+			-shortcomment => "This plugin reports the status of an network printer with an SNMP management module.",
+			-parameterlists => [ [ $H_opt, $C_opt, $P_opt, $p_opt, $v_opt, $t_opt, $d_opt ], $h_opts, $V_opts ]);
 
 $ENV{'PATH'}='';
 $ENV{'BASH_ENV'}=''; 
@@ -96,68 +124,29 @@
 # defaults 
 my $ptype = 1;  						# to standard RFC printer type
 my $state = $ERRORS{'UNKNOWN'};
-my $community = "public";
-my $snmp_version = 1;
-my $port = 161;
-
-Getopt::Long::Configure('bundling');
-GetOptions
-	("d"   => \$opt_d, "debug"			=> \$opt_d,
-	 "V"   => \$opt_V, "version"		=> \$opt_V,
-	 "P=s" => \$opt_P, "Printer=s"      => \$opt_P,    # printer type - HP or RFC
-	 "v=i" => \$snmp_version, "snmp_version=i"  => \$snmp_version,
-	 "p=i" => \$port, "port=i" => \$port,
-	 "C=s" => \$community,"community=s" => \$community,
-	 "h"   => \$opt_h, "help"		=> \$opt_h,
-	 "H=s" => \$opt_H, "hostname=s"		=> \$opt_H);
-
-
 
-$PROGNAME = "check_snmp_printer";
-
-if ($opt_V) {
-	print_revision($PROGNAME,'$Revision: 1.1 $');
-	exit $ERRORS{'OK'};
-}
-
-if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
+$plugin->init();
 
-unless (defined $opt_H) {
-	print "No target hostname specified\n";
-	exit $ERRORS{"UNKNOWN"};
-}
-$hostname = $opt_H;
-if (! utils::is_hostname($hostname)){
-	usage(" $hostname did not match pattern\n");
-	exit $ERRORS{"UNKNOWN"};
+if ($opt_P eq "HP" ) {
+  $ptype = 2;
+}elsif ($opt_P eq "RFC" ) {
+  $ptype = 1;
 }
 
-if (defined $opt_P) {
-	if ($opt_P eq "HP" ) {
-		$ptype = 2;
-	}elsif ($opt_P eq "RFC" ) {
-		$ptype = 1;
-	}else{
-		print "Only \"HP\" and \"RFC\" are supported as printer options at this time.\n";
-		exit $ERRORS{"UNKNOWN"};
-	}
-}
-
-
 if ( $snmp_version =~ /[12]/ ) {
-		
-	($session, $error) = Net::SNMP->session(
-	      -hostname  => $hostname,
-	      -community => $community,
-	      -port      => $port,
-		  -version	=> $snmp_version
-		   );
+  
+	($session, $error) = Net::SNMP->session(-hostname  => $hostname,
+						-community => $community,
+						-port      => $port,
+						-version   => $snmp_version,
+						-timeout   => $opt_t
+					       );
 
 	if (!defined($session)) {
-	      $state='UNKNOWN';
-	      $answer=$error;
-	      print ("$state: no session - $answer\n");
-	      exit $ERRORS{$state};
+	  $state='UNKNOWN';
+	  $answer=$error;
+	  print ("$PROGNAME $state: no session - $answer\n");
+	  exit $ERRORS{$state};
 	}
 
 	print "Opened session|" if (defined ($opt_d));
@@ -430,7 +419,8 @@
 		
 		for $inst (@display_index) {
 			$state = 'WARNING';
-			if ( $snmp_response{$std_mib{'std_mib_alert_location'} . "." . $inst} < 1) {
+			if ( !defined $snmp_response{$std_mib{'std_mib_alert_location'} . "." . $inst}
+			     || $snmp_response{$std_mib{'std_mib_alert_location'} . "." . $inst} < 1) {
 				$answer .= "unknown location ";
 			}else{
 				$answer .= $std_mib_prt_alert_code{$snmp_response{$std_mib{'std_mib_alert_location'} . "." . $inst} } . " ";
@@ -566,40 +556,3 @@
 	
 
 }
-
-sub print_usage () {
-	print "Usage: $PROGNAME -H <host> [-C community] [-P HP or RFC] [-p port]  [-v snmp_version] [-h help]  [-V version]\n";
-}
-
-sub print_help () {
-	print_revision($PROGNAME,'$Revision: 1.1 $');
-	print "Copyright (c) 2002 Subhendu Ghosh/Ethan Galstad.
-
-This plugin reports the status of an network printer with an SNMP management
-module.
-
-";
-	print_usage();
-	print "
--H, --hostname=HOST
-   Name or IP address of host to check
--C --community
-   snmp community string (default: public)
--P --Printer
-   supported values are \"HP\" for Jetdirect printers and
-   \"RFC\" for RFC 1759 Print MIB based implementations (default: RFC)
--p --port
-   Port where snmp agent is listening (default: 161)
--v --snmp_version
-   SNMP version to use (default: version 1)
--h --help
-   This screen
--V --version
-   Plugin version
-
-";
-	support();
-}
-
-
-
