diff -ruN nagiosplug-save/contrib/check_digitemp.pl nagiosplug/contrib/check_digitemp.pl
--- nagiosplug-save/contrib/check_digitemp.pl	2002-08-01 05:46:01.000000000 +0100
+++ nagiosplug/contrib/check_digitemp.pl	2004-03-27 21:53:04.000000000 +0000
@@ -110,143 +110,123 @@
 # ===========================================================================
 
 # Modules to use
+
+require 5.004;
 use strict;
-use Getopt::Std;
+use lib utils.pm ;
+use Plugin;
+use Plugin::Parameter qw($helpparameterlist $versionparameterlist $configfileparameter
+			 $warningparameter $criticalparameter $timeoutparameter
+			 $verboseparameter);
 
 # Define all our variable usage
-use vars qw($opt_c $opt_f $opt_t $opt_w $opt_F $opt_C
-	    $temperature $conf_file $sensor $temp_fmt
+use vars qw($opt_c $opt_f $opt_s $opt_t $opt_w $opt_F $opt_C $xml $opt_V $opt_h
+	    $temperature $conf_file $temp_fmt
 	    $crit_level $warn_level $null
-            %exit_codes
             $percent $fmt_pct 
-            $verb_err $command_line);
+            $verb_err $command_line $PROGNAME);
+use utils qw(%ERRORS &usage);
 
+$configfileparameter->default("/etc/digitemp.conf");
+$configfileparameter->description("Digitemp Config File");
+my $sensorparameter = new Plugin::Parameter(-name => "sensor", -flags => [ 's', 'sensor' ],
+					    -optional => "yes", -valueoptional => 0, -type => "INTEGER",
+					    -default => 0,
+					    -description => "Digitemp sensor number");
+my $fahrenheitparameter = new Plugin::Parameter(-name => "fahrenheit", -flags => [ 'F', 'fahrenheit' ],
+						-optional => "yes", -valueoptional => "yes",
+						-description => "Temperatures in Fahrenheit");
+my $centigradeparameter = new Plugin::Parameter(-name => "centigrade", -flags => [ 'C', 'centigrade' ],
+						-optional => "yes", -valueoptional => "yes",
+						-description => "Temperatures in Centigrade");
+$warningparameter->type("TEMPERATURE");
+$warningparameter->optional("no");
+$warningparameter->checker(\&Plugin::Parameter::_check_temperature);
+$warningparameter->description("warning temperature threshold");
+$criticalparameter->type("TEMPERATURE");
+$criticalparameter->optional("no");
+$criticalparameter->checker(\&Plugin::Parameter::_check_temperature);
+$criticalparameter->description("critical temperature threshold");
+
+my @commandparameterlist = ( $configfileparameter,
+			     $sensorparameter,
+			     $fahrenheitparameter,
+			     $centigradeparameter,
+			     $warningparameter,
+			     $criticalparameter,
+			     $verboseparameter );
+
+my $plugin = new Plugin(-revision => '$Revision: 1.1 $',
+			-copyright => "2002 Brian C. Lane <bcl\@brianlane.com>, Howard Wilkinson <howard\@cohtech.com>",
+			-shortcomment => "This plugin checks the temperature information returned by a digitemp sensor.",
+			-parameterlists => [ \@commandparameterlist, $helpparameterlist, $versionparameterlist ],
+		        -checker => sub { my ($plugin) = @_;
+					  if ($opt_w >= $opt_c) {
+					    $plugin->usage();
+					    &utils::usage("$PROGNAME UNKNOWN: *** WARN level must not be greater than CRITICAL when checking temperature!\n");
+					  }
+					  if (!-f $opt_f) {
+					    $plugin->usage();
+					    &utils::usage("$PROGNAME UNKNOWN: *** You must have a digitemp.conf file\n");
+					  }
+					  if ($opt_C && $opt_F) {
+					    $plugin->usage();
+					    &utils::usage("$PROGNAME UNKNOWN: Cannot specify both centrigrade and fahrenheit\n");
+					  } });
 
-# Predefined exit codes for NetSaint
-%exit_codes   = ('UNKNOWN' ,-1,
-		      'OK'      , 0,
-                      'WARNING' , 1,
-                      'CRITICAL', 2,);
+$plugin->init();
 
 # Default to Fahrenheit input and result (use -C to change this)
 $temp_fmt = 3;
 
-
-# Get the options
-if ($#ARGV le 0)
-{
-  &usage;
-} else {
-  getopts('f:t:FCc:w:');
-}
-
-# Shortcircuit the switches
-if (!$opt_w or $opt_w == 0 or !$opt_c or $opt_c == 0)
-{
-  print "*** You must define WARN and CRITICAL levels!";
-  &usage;
-}
-
-# Check if levels are sane
-if ($opt_w >= $opt_c)
-{
-  print "*** WARN level must not be greater than CRITICAL when checking temperature!";
-  &usage;
-}
-
-
-$warn_level   = $opt_w;
-$crit_level   = $opt_c;
-
-# Default sensor to read is #0
-if(!$opt_t)
-{
-  $sensor = 0;
-} else {
-  $sensor = $opt_t;
-}
-
-# Default config file is /etc/digitemp.conf
-if(!$opt_f)
-{
-  $conf_file = "/etc/digitemp.conf";
-} else {
-  $conf_file = $opt_f;
-}
-
-# Check for config file
-if( !-f $conf_file ) {
-  print "*** You must have a digitemp.conf file\n";
-  &usage;
-}
-
-
-if($opt_C)
-{
+if($opt_C) {
   $temp_fmt = 2;
 }
 
+$plugin->start_timeout($opt_t, "No response from digitemp (alarm)");
+
 # Read the output from digitemp
 # Output in form 0\troom\tattic\tdrink
-open( DIGITEMP, "/usr/local/bin/digitemp -c $conf_file -t $sensor -q -o $temp_fmt |" );
+open( DIGITEMP, "/usr/local/bin/digitemp -c $opt_f -t $opt_s -q -o $temp_fmt |" );
 
+my $status = 'UNKNOWN';
+my $message = "";
 # Process the output from the command
-while( <DIGITEMP> )
-{
-#  print "$_\n";
+while( <DIGITEMP> ) {
   chomp;
 
-  if( $_ =~ /^nanosleep/i )
-  {
-    print "Error reading sensor #$sensor\n";
-    close(DIGITEMP);
-    exit $exit_codes{'UNKNOWN'};
+  if( $_ =~ /^nanosleep/i ) {
+    $message = "Error reading sensor #$opt_s";
+    last;
   } else {
     # Check for an error from digitemp, and report it instead
     if( $_ =~ /^Error.*/i ) {
-      print $_;
-      close(DIGITEMP);
-      exit $exit_codes{'UNKNOWN'};
+      $message = $_;
     } else {
-      ($null,$temperature) = split(/\t/);
+      ($null,$temperature) = split(/\t/); # Last record only???
     }
   }
 }
 close( DIGITEMP );
 
-if( $temperature and $temperature >= $crit_level )
-{
-  print "Temperature CRITICAL - Sensor #$sensor = $temperature ";
-  if( $temp_fmt == 3 ) { print "F\n"; } else { print "C\n"; }
-  exit $exit_codes{'CRITICAL'};
-} elsif ($temperature and $temperature >= $warn_level ) {
-  print "Temperature WARNING - Sensor #$sensor = $temperature ";
-  if( $temp_fmt == 3 ) { print "F\n"; } else { print "C\n"; }
-  exit $exit_codes{'WARNING'};
+$plugin->stop_timeout();
+
+if (!$message && !$temperature) {
+  $message = "Error parsing result for sensor #$opt_s";
+} elsif( $temperature && $temperature >= $opt_c ) {
+  $message = "Temperature CRITICAL - Sensor #$opt_s = $temperature"
+  . ( $temp_fmt == 3 )?"F":"C";
+  $status = 'CRITICAL';
+} elsif ($temperature && $temperature >= $opt_w ) {
+  $message = "Temperature WARNING - Sensor #$opt_s = $temperature"
+    .( $temp_fmt == 3 )?"F":"C";
+  $status = 'WARNING';
 } elsif( $temperature ) {
-  print "Temperature OK - Sensor #$sensor = $temperature ";
-  if( $temp_fmt == 3 ) { print "F\n"; } else { print "C\n"; }
-  exit $exit_codes{'OK'};
-} else {
-    print "Error parsing result for sensor #$sensor\n";
-    exit $exit_codes{'UNKNOWN'};  
+  $message = "Temperature OK - Sensor #$opt_s = $temperature"
+    . ( $temp_fmt == 3 )?"F":"C";
+  $status = 'OK';
 }
 
-# Show usage
-sub usage()
-{
-  print "\ncheck_digitemp.pl v1.0 - NetSaint Plugin\n";
-  print "Copyright 2002 by Brian C. Lane <bcl\@brianlane.com>\n";
-  print "See source for License\n";
-  print "usage:\n";
-  print " check_digitemp.pl -t <sensor> -f <config file> -w <warnlevel> -c <critlevel>\n\n";
-  print "options:\n";
-  print " -f               DigiTemp Config File\n";
-  print " -t               DigiTemp Sensor #\n";
-  print " -F               Temperature in Fahrenheit\n";
-  print " -C               Temperature in Centigrade\n";
-  print " -w temperature   temperature >= to warn\n";
-  print " -c temperature   temperature >= when critical\n";
+print "$PROGNAME $status: $message\n";
+exit $ERRORS{$status};
 
-  exit $exit_codes{'UNKNOWN'}; 
-}
