summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_ircd.pl
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts/check_ircd.pl')
-rwxr-xr-xplugins-scripts/check_ircd.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
index 6d40cf5..d869ae7 100755
--- a/plugins-scripts/check_ircd.pl
+++ b/plugins-scripts/check_ircd.pl
@@ -51,7 +51,6 @@ use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
51use vars qw($PROGNAME); 51use vars qw($PROGNAME);
52use FindBin; 52use FindBin;
53use lib "$FindBin::Bin"; 53use lib "$FindBin::Bin";
54use lib '@libexecdir@';
55use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 54use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
56 55
57# ----------------------------------------------------[ Function Prototypes ]-- 56# ----------------------------------------------------[ Function Prototypes ]--
@@ -70,7 +69,9 @@ $ENV{'ENV'}='';
70# -----------------------------------------------------------------[ Global ]-- 69# -----------------------------------------------------------------[ Global ]--
71 70
72$PROGNAME = "check_ircd"; 71$PROGNAME = "check_ircd";
73my $NICK="ircd$$"; 72# nickname shouldn't be longer than 9 chars, this might happen with large PIDs
73# To prevent this, we cut of the part over 10000
74my $NICK="ircd" . $$ % 10000;
74my $USER_INFO="monitor localhost localhost : "; 75my $USER_INFO="monitor localhost localhost : ";
75 76
76# -------------------------------------------------------------[ connection ]-- 77# -------------------------------------------------------------[ connection ]--
@@ -182,10 +183,10 @@ MAIN:
182 183
183 if ($opt_V) { 184 if ($opt_V) {
184 print_revision($PROGNAME,'@NP_VERSION@'); 185 print_revision($PROGNAME,'@NP_VERSION@');
185 exit $ERRORS{'OK'}; 186 exit $ERRORS{'UNKNOWN'};
186 } 187 }
187 188
188 if ($opt_h) {print_help(); exit $ERRORS{'OK'};} 189 if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
189 190
190 ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n"); 191 ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n");
191 my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); 192 my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);