diff -ruN nagiosplug-save/contrib/checkciscotemp.pl nagiosplug/contrib/checkciscotemp.pl
--- nagiosplug-save/contrib/checkciscotemp.pl	2003-01-28 07:44:56.000000000 +0000
+++ nagiosplug/contrib/checkciscotemp.pl	2004-03-27 23:19:22.000000000 +0000
@@ -30,79 +30,77 @@
 # (in accordance with the plugin coding guidelines)
 ####################################
 
+require 5.004;
+use strict;
+use lib utils.pm ;
+use Plugin;
+use Plugin::Parameter qw($helpparameterlist $versionparameterlist $hostnameparameter
+			 $communityparameter $portparameter $timeoutparameter
+			 $criticalparameter $warningparameter $verboseparameter);
 use Net::SNMP;
-use Getopt::Long;
-&Getopt::Long::config('auto_abbrev');
+use vars qw($opt_H $opt_C $opt_p $opt_t $opt_v $ithresh $othresh
+	    $inlet_thresh $outlet_thresh $inlet_warn $outlet_warn
+	    $PROGNAME);
+use utils qw(%ERRORS);
+
+$portparameter->default(161);
+$warningparameter->type("THRESHOLD");
+$warningparameter->checker(sub { my ($opt, $parameter, $plugin) = @_;
+				 if (!defined $$opt) { return; }
+				 &Plugin::Parameter::_check_threshold($opt, $parameter, $plugin);
+				 $$opt =~ m/^(\d+)[,:](\d+)$/;
+				 ($inlet_warn, $outlet_warn) = ($1, $2);
+			       });
+$warningparameter->description("Warning threshold values");
+$warningparameter->required("no");
+$criticalparameter->type("THRESHOLD");
+$criticalparameter->checker(sub { my ($opt, $parameter, $plugin) = @_;
+				  if (!defined $$opt) { return; }
+				  &Plugin::Parameter::_check_threshold($opt, $parameter, $plugin);
+				  $$opt =~ m/^(\d+)[,:](\d+)$/;
+				  ($inlet_thresh, $outlet_thresh) = ($1, $2);
+				});
+$criticalparameter->description("Critical threshold values");
+$criticalparameter->required("no");
+my $ithreshparameter = new Plugin::Parameter(-name => "ithresh", -flags => [ 'ithresh' ],
+					     -optional => "yes", -valueoptional => "no", -type => "TEMPERATURE", -default => 30,
+					     -checker => \&Plugin::Parameter::_check_temperature,
+					     -binding => \$ithresh,
+					     -description => "Inlet temperature threshold");
+my $othreshparameter = new Plugin::Parameter(-name => "othresh", -flags => [ 'othresh' ],
+					     -optional => "yes", -valueoptional => "no", -type => "TEMPERATURE", -default => 40,
+					     -checker => \&Plugin::Parameter::_check_temperature,
+					     -binding => \$othresh,
+					     -description => "Outlet temperature threshold");
+my @commandparameterlist = ( $hostnameparameter,
+			     $communityparameter,
+			     $ithreshparameter,
+			     $othreshparameter,
+			     $warningparameter,
+			     $criticalparameter,
+			     $portparameter,
+			     $timeoutparameter,
+			     $verboseparameter );
+
+my $plugin = new Plugin(-revision => '$Revision: 1.3 $',
+			-copyright => "2000  Leland E. Vandervort <leland\@mmania.com>, 2004 Howard Wilkinson <howard\cohtech.com>",
+			-shortcomment => "Perl envmon temperature plugin for Nagios",
+			-checker => sub { my ($plugin) = @_;
+					  $inlet_warn = $ithresh unless (defined $inlet_warn);
+					  $outlet_warn = $othresh unless (defined $outlet_warn);
+					  $inlet_thresh = $ithresh unless (defined $inlet_thresh);
+					  $outlet_thresh = $othresh unless (defined $outlet_thresh); },
+			-parameterlists => [ \@commandparameterlist, $helpparameterlist, $versionparameterlist ]);
+
+$plugin->init();
 
-my $status;
-my $response = "";
-my $timeout = 10;
-my $community = "public";
-my $port = 161;
 my $INTAKE_TEMP = "1.3.6.1.4.1.9.9.13.1.3.1.3.1";
 my $OUTLET_TEMP = "1.3.6.1.4.1.9.9.13.1.3.1.3.3";
-my $in_temp;
-my $out_temp;
-my $inlet_thresh = 30;
-my $outlet_thresh = 40;
-
-my %STATUSCODE = (  'UNKNOWN' => '-1',
-                    'OK' => '0',
-                    'WARNING' => '1',
-                    'CRITICAL' => '2');
 
 my $state = "UNKNOWN";
 
-
-$SIG{'ALRM'} = sub {
-    print "ERROR: No snmp response from $hostname (sigALRM)\n";
-    exit($STATUSCODE{"UNKNOWN"});
-};
-
-Getopt::Long::Configure('bundling');
-$status = GetOptions
-	("community=s", \$community,
-	 "C=s",         \$community,
-	 "H=s",         \$hostname,
-	 "hostname=s",  \$hostname,
-	 "port=i",      \$port,
-	 "timeout=i",   \$timeout,
-	 "c=s",         \$critical_vals,
-	 "w=s",         \$warning_vals,
-	 "ithresh=i",   \$inlet_thresh,
-	 "othresh=i",   \$outlet_thresh);
-                     
-if($status == 0) {
-    &show_help;
-}
-
-unless (defined($hostname)) {
-    $hostname = shift || &show_help;
-}
-
-if (defined($critical_vals)) {
-    if ($critical_vals =~ m/^([0-9]+)[,:]([0-9]+)$/) {
-        ($inlet_thresh,$outlet_thresh) = ($1, $2);
-    } else {
-        die "Cannot Parse Critical Thresholds\n";
-    }
-}
-
-if (defined($warning_vals)) {
-    if ($warning_vals =~ m/^([0-9]+)[:,]([0-9]+)$/) {
-        ($inlet_warn,$outlet_warn) = ($1, $2);
-    } else {
-        die "Cannot Parse Warning Thresholds\n";
-    }
-}else{
-    $inlet_warn=$inlet_thresh;
-    $outlet_warn=$outlet_thresh;
-}
-
-alarm($timeout);                    
-
-$in_temp = &SNMPGET($INTAKE_TEMP);
-$out_temp = &SNMPGET($OUTLET_TEMP);
+my $in_temp = &SNMPGET($INTAKE_TEMP);
+my $out_temp = &SNMPGET($OUTLET_TEMP);
 
 if (($in_temp < $inlet_thresh) && ($out_temp < $outlet_thresh)) {
     $state = "OK";
@@ -122,43 +120,25 @@
     $state = "WARNING";
 }
 
-print "$state Inlet Temp: $in_temp Outlet Temp: $out_temp\n";
-exit($STATUSCODE{$state});
-
-sub show_help {
-    printf("\nPerl envmon temperature plugin for Nagios\n");
-    printf("Usage:\n");
-    printf("
-  check_ciscotemp [options] <hostname>
-  Options:
-    -C snmp-community
-    -p snmp-port
-    -i input temperature threshold
-    -o output temperature threshold
-
-");
-    printf("Copyright (C)2000 Leland E. Vandervort\n");
-    printf("check_ciscotemp comes with absolutely NO WARRANTY either implied or explicit\n");
-    printf("This program is licensed under the terms of the\n");
-    printf("GNU General Public License\n(check source code for details)\n\n\n");
-    exit($STATUSCODE{"UNKNOWN"});
-}
+print "$PROGNAME $state: Inlet Temp: $in_temp Outlet Temp: $out_temp\n";
+exit($ERRORS{$state});
 
 sub SNMPGET {
-    $OID = shift;
-    ($session,$error) = Net::SNMP->session(
-        Hostname        =>      $hostname,
-        Community       =>      $community,
-        Port            =>      $port
-        );
+    my $OID = shift;
+    my ($session,$error) = Net::SNMP->session(-Hostname        =>      $opt_H,
+					      -Community       =>      $opt_C,
+					      -Port            =>      $opt_p,
+					      -Version         =>      "snmpv1",
+					      -Timeout         =>      $opt_t);
     if(!defined($session)) {
-        printf("$state %s\n", $error);
-        exit($STATUSCODE{$state});
+        printf("$PROGNAME $state: %s\n", $error);
+        exit($ERRORS{$state});
     }
-    if(!defined($response = $session->get_request($OID))) {
-        printf("$state %s\n", $session->error());
+    my $response = $session->get_request($OID);
+    if(!defined $response) {
+        printf("$PROGNAME $state: %s\n", $session->error());
         $session->close();
-	exit($STATUSCODE{$state});
+	exit($ERRORS{$state});
     }
     $session->close();
     return($response->{$OID});
