summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2010-04-12 13:36:33 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2010-04-12 13:36:33 (GMT)
commit7a661c7aed2a0bad4ce1e3786bc707cd2b07c128 (patch)
treea61b0d7d8c42f6710c4e95dd61da7dd7a82b5e7c /plugins-scripts
parent08f83072048f2c4c783c3216f5933f04b191847f (diff)
downloadmonitoring-plugins-7a661c7aed2a0bad4ce1e3786bc707cd2b07c128.tar.gz
Fix Debian bug #545940: Failure when run via ePN
If Perl's "shift" function is called outside of a subroutine and without any argument, it usually shifts @ARGV. However, if a plugin is executed via ePN, such a call will shift @_ instead, so we must explicitly specify @ARGV for this to work as expected. This fixes Debian bug #545940, see: http://bugs.debian.org/545940 Commit de7191e3424e02ba278a39b86e8b1906a25d0362 fixed the same issue for check_disk_smb. (Reported by Hendrik Jaeger, forwarded by Jan Wagner.)
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_ircd.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
index 3fbce2e..42a9bca 100755
--- a/plugins-scripts/check_ircd.pl
+++ b/plugins-scripts/check_ircd.pl
@@ -187,19 +187,19 @@ MAIN:
187 187
188 if ($opt_h) {print_help(); exit $ERRORS{'OK'};} 188 if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
189 189
190 ($opt_H) || ($opt_H = shift) || usage("Host name/address not specified\n"); 190 ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n");
191 my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); 191 my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
192 ($remotehost) || usage("Invalid host: $opt_H\n"); 192 ($remotehost) || usage("Invalid host: $opt_H\n");
193 193
194 ($opt_w) || ($opt_w = shift) || ($opt_w = 50); 194 ($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 50);
195 my $warn = $1 if ($opt_w =~ /^([0-9]+)$/); 195 my $warn = $1 if ($opt_w =~ /^([0-9]+)$/);
196 ($warn) || usage("Invalid warning threshold: $opt_w\n"); 196 ($warn) || usage("Invalid warning threshold: $opt_w\n");
197 197
198 ($opt_c) || ($opt_c = shift) || ($opt_c = 100); 198 ($opt_c) || ($opt_c = shift @ARGV) || ($opt_c = 100);
199 my $crit = $1 if ($opt_c =~ /^([0-9]+)$/); 199 my $crit = $1 if ($opt_c =~ /^([0-9]+)$/);
200 ($crit) || usage("Invalid critical threshold: $opt_c\n"); 200 ($crit) || usage("Invalid critical threshold: $opt_c\n");
201 201
202 ($opt_p) || ($opt_p = shift) || ($opt_p = 6667); 202 ($opt_p) || ($opt_p = shift @ARGV) || ($opt_p = 6667);
203 my $remoteport = $1 if ($opt_p =~ /^([0-9]+)$/); 203 my $remoteport = $1 if ($opt_p =~ /^([0-9]+)$/);
204 ($remoteport) || usage("Invalid port: $opt_p\n"); 204 ($remoteport) || usage("Invalid port: $opt_p\n");
205 205