diff options
Diffstat (limited to 'plugins-scripts/check_ircd.pl')
-rwxr-xr-x | plugins-scripts/check_ircd.pl | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl index 42a9bca9..afedfb95 100755 --- a/plugins-scripts/check_ircd.pl +++ b/plugins-scripts/check_ircd.pl | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/perl -wT | 1 | #!@PERL@ -w |
2 | 2 | ||
3 | # ----------------------------------------------------------------------------- | 3 | # ----------------------------------------------------------------------------- |
4 | # File Name: check_ircd.pl | 4 | # File Name: check_ircd.pl |
@@ -16,8 +16,6 @@ | |||
16 | # ----------------------------------------------------------------------------- | 16 | # ----------------------------------------------------------------------------- |
17 | # Copyright 1999 (c) Richard Mayhew | 17 | # Copyright 1999 (c) Richard Mayhew |
18 | # | 18 | # |
19 | # Credits go to Ethan Galstad for coding Nagios | ||
20 | # | ||
21 | # If any changes are made to this script, please mail me a copy of the | 19 | # If any changes are made to this script, please mail me a copy of the |
22 | # changes :) | 20 | # changes :) |
23 | # | 21 | # |
@@ -51,7 +49,8 @@ use strict; | |||
51 | use Getopt::Long; | 49 | use Getopt::Long; |
52 | use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose); | 50 | use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose); |
53 | use vars qw($PROGNAME); | 51 | use vars qw($PROGNAME); |
54 | use lib utils.pm; | 52 | use FindBin; |
53 | use lib "$FindBin::Bin"; | ||
55 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); | 54 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); |
56 | 55 | ||
57 | # ----------------------------------------------------[ Function Prototypes ]-- | 56 | # ----------------------------------------------------[ Function Prototypes ]-- |
@@ -63,9 +62,9 @@ sub bindRemote ($$); | |||
63 | 62 | ||
64 | # -------------------------------------------------------------[ Enviroment ]-- | 63 | # -------------------------------------------------------------[ Enviroment ]-- |
65 | 64 | ||
66 | $ENV{PATH} = ""; | 65 | $ENV{'PATH'}='@TRUSTED_PATH@'; |
67 | $ENV{ENV} = ""; | 66 | $ENV{'BASH_ENV'}=''; |
68 | $ENV{BASH_ENV} = ""; | 67 | $ENV{'ENV'}=''; |
69 | 68 | ||
70 | # -----------------------------------------------------------------[ Global ]-- | 69 | # -----------------------------------------------------------------[ Global ]-- |
71 | 70 | ||
@@ -121,7 +120,7 @@ sub print_help () | |||
121 | print_revision($PROGNAME,'@NP_VERSION@'); | 120 | print_revision($PROGNAME,'@NP_VERSION@'); |
122 | print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop | 121 | print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop |
123 | 122 | ||
124 | Perl Check IRCD plugin for Nagios | 123 | Perl Check IRCD plugin for monitoring |
125 | 124 | ||
126 | "; | 125 | "; |
127 | print_usage(); | 126 | print_usage(); |
@@ -205,7 +204,7 @@ MAIN: | |||
205 | 204 | ||
206 | if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; } | 205 | if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; } |
207 | 206 | ||
208 | # Just in case of problems, let's not hang Nagios | 207 | # Just in case of problems, let's not hang the monitoring system |
209 | $SIG{'ALRM'} = sub { | 208 | $SIG{'ALRM'} = sub { |
210 | print "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n"; | 209 | print "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n"; |
211 | exit $ERRORS{"UNKNOWN"}; | 210 | exit $ERRORS{"UNKNOWN"}; |