diff -ruN nagiosplug-save/plugins-scripts/check_ircd.pl nagiosplug/plugins-scripts/check_ircd.pl
--- nagiosplug-save/plugins-scripts/check_ircd.pl	2002-05-07 06:35:49.000000000 +0100
+++ nagiosplug/plugins-scripts/check_ircd.pl	2004-03-27 22:47:52.000000000 +0000
@@ -47,18 +47,20 @@
 
 # -------------------------------------------------------------------[ Uses ]--
 
-use Socket;
 use strict;
-use Getopt::Long;
-use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
-use vars qw($PROGNAME);
 use lib utils.pm;
-use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
+use Plugin;
+use Plugin::Parameter qw(:DEFAULT :standard $p_opt);
+
+use Socket;
+
+use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $opt_v);
+use vars qw($PROGNAME);
+
+use utils qw(%ERRORS &usage);
 
 # ----------------------------------------------------[ Function Prototypes ]--
 
-sub print_help ();
-sub print_usage ();
 sub connection ($$$$);
 sub bindRemote ($$$);
 
@@ -70,9 +72,17 @@
 
 # -----------------------------------------------------------------[ Global ]--
 
-$PROGNAME = "check_ircd";
 my $NICK="ircd$$";
 my $USER_INFO="monitor localhost localhost : ";
+
+$w_opt->default(50);
+$c_opt->default(100);
+$p_opt->default(6667);
+my $plugin = new Plugin(-revision => '$Revision: 1.3 $',
+			-copyright => "2000 Richard Mayhew/Karl DeBisschop, 2004 Howard Wilkinson <howard\@cohtech.com>",
+			-shortcomment => "Perl Check IRCD plugin for Nagios",
+			-parameterlists => [ [ @standardparameters, $p_opt ],
+					     $h_opts, $V_opts ]);
 	
 # -------------------------------------------------------------[ connection ]--
 sub connection ($$$$)
@@ -81,7 +91,7 @@
 	my $state;
 	my $answer;
 
-	print "connection(debug): users = $in_users\n" if $verbose;
+	print "connection(debug): users = $in_users\n" if $opt_v;
 	$in_users =~ s/\ //g;
 	
 	if ($in_users >= 0) {
@@ -109,37 +119,6 @@
 	exit $ERRORS{$state};
 }
 
-# ------------------------------------------------------------[ print_usage ]--
-
-sub print_usage () {
-	print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>] [-p <port>]\n";
-}
-
-# -------------------------------------------------------------[ print_help ]--
-
-sub print_help ()
-{
-	print_revision($PROGNAME,'$Revision: 1.3 $ ');
-	print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop
-
-Perl Check IRCD plugin for Nagios
-
-";
-	print_usage();
-	print "
--H, --hostname=HOST
-   Name or IP address of host to check
--w, --warning=INTEGER
-   Number of connected users which generates a warning state (Default: 50)
--c, --critical=INTEGER
-   Number of connected users which generates a critical state (Default: 100)
--p, --port=INTEGER
-   Port that the ircd daemon is running on <host> (Default: 6667)
--v, --verbose
-   Print extra debugging information
-";
-}
-
 # -------------------------------------------------------------[ bindRemote ]--
 
 sub bindRemote ($$$)
@@ -178,62 +157,23 @@
 {
 	my $hostname;
 
-	Getopt::Long::Configure('bundling');
-	GetOptions
-	 ("V"   => \$opt_V,  "version"    => \$opt_V,
-		"h"   => \$opt_h,  "help"       => \$opt_h,
-		"v"   => \$verbose,"verbose"    => \$verbose,
-		"t=i" => \$opt_t,  "timeout=i"  => \$opt_t,
-		"w=i" => \$opt_w,  "warning=i"  => \$opt_w,
-		"c=i" => \$opt_c,  "critical=i" => \$opt_c,
-		"p=i" => \$opt_p,  "port=i"     => \$opt_p,
-		"H=s" => \$opt_H,  "hostname=s" => \$opt_H);
-
-	if ($opt_V) {
-		print_revision($PROGNAME,'$Revision: 1.3 $ ');
-		exit $ERRORS{'OK'};
-	}
-
-	if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
+	$plugin->init();
 
-	($opt_H) || ($opt_H = shift) || usage("Host name/address not specified\n");
-	my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
-	($remotehost) || usage("Invalid host: $opt_H\n");
-
-	($opt_w) || ($opt_w = shift) || ($opt_w = 50);
-	my $warn = $1 if ($opt_w =~ /^([0-9]+)$/);
-	($warn) || usage("Invalid warning threshold: $opt_w\n");
-
-	($opt_c) || ($opt_c = shift) || ($opt_c = 100);
-	my $crit = $1 if ($opt_c =~ /^([0-9]+)$/);
-	($crit) || usage("Invalid critical threshold: $opt_c\n");
-
-	($opt_p) || ($opt_p = shift) || ($opt_p = 6667);
-	my $remoteport = $1 if ($opt_p =~ /^([0-9]+)$/);
-	($remoteport) || usage("Invalid port: $opt_p\n");
-
-	if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; }
-
-	# Just in case of problems, let's not hang Nagios
-	$SIG{'ALRM'} = sub {
-		print "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n";
-		exit $ERRORS{"UNKNOWN"};
-	};
-	
-	alarm($TIMEOUT);
+	$plugin->start_timeout($opt_t,
+			       "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $opt_t Seconds)");
 
 	chomp($hostname = `/bin/hostname`);
 	$hostname = $1 if ($hostname =~ /([-.a-zA-Z0-9]+)/);
 	my ($name, $alias, $proto) = getprotobyname('tcp');
-	print "MAIN(debug): hostname = $hostname\n" if $verbose;
+	print "MAIN(debug): hostname = $hostname\n" if $opt_v;
 
-	print "MAIN(debug): binding to remote host: $remotehost -> $remoteport -> $hostname\n" if $verbose;
-	my $ClientSocket = &bindRemote($remotehost,$remoteport,$hostname);
+	print "MAIN(debug): binding to remote host: $opt_H -> $opt_p -> $hostname\n" if $opt_v;
+	my $ClientSocket = &bindRemote($opt_H,$opt_p,$hostname);
 	
 	print ClientSocket "NICK $NICK\nUSER $USER_INFO\n";
 	
 	while (<ClientSocket>) {
-		print "MAIN(debug): default var = $_\n" if $verbose;
+		print "MAIN(debug): default var = $_\n" if $opt_v;
 
 		# DALnet,LagNet,UnderNet etc. Require this!
 		# Replies with a PONG when presented with a PING query.
@@ -241,10 +181,10 @@
 	
 		if (m/^PING (.*)/) {print ClientSocket "PONG $1\n";}
 	
-		alarm(0);
+		$plugin->stop_timeout();
 	
 		# Look for pattern in IRCD Output to gather Client Connections total.
-		connection($remotehost,$1,$warn,$crit) if (m/:I have\s+(\d+)/);
+		connection($opt_H,$1,$opt_w,$opt_c) if (m/:I have\s+(\d+)/);
 	}
 	print "IRCD UNKNOWN: Unknown error - maybe could not authenticate\n";
 	exit $ERRORS{"UNKNOWN"};
