summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_disk_smb.pl
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2010-04-11 09:54:10 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2010-04-11 09:54:10 +0200
commitde7191e3424e02ba278a39b86e8b1906a25d0362 (patch)
tree71ac9b1b6c41db047f615b6b691a12e0aebf9e8e /plugins-scripts/check_disk_smb.pl
parent1fe0f16d34e369f1a9e2dbefe1acc7448a1e1b53 (diff)
downloadmonitoring-plugins-de7191e3424e02ba278a39b86e8b1906a25d0362.tar.gz
Fix Debian bug #478906: Failure when run via ePN
| When perl plugin scripts are run with the embedded perl interpreter in | nagios3, the "shift" perl command doesn't shift @ARGV, but @_ (which | happens to contain the same thing as @ARGV at the time the script was | started). | | [...] | | A fix is to replace all the instances of "shift" with "shift @ARGV". [ http://bugs.debian.org/478906 ] (Fixed by Stephane Chazelas, forwarded by Jan Wagner.)
Diffstat (limited to 'plugins-scripts/check_disk_smb.pl')
-rwxr-xr-xplugins-scripts/check_disk_smb.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 022fa505..ca593d46 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -64,27 +64,27 @@ my $smbclientoptions= $opt_P ? "-p $opt_P " : "";
64 64
65# Options checking 65# Options checking
66 66
67($opt_H) || ($opt_H = shift) || usage("Host name not specified\n"); 67($opt_H) || ($opt_H = shift @ARGV) || usage("Host name not specified\n");
68my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9 ]+\$?)$/); 68my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9 ]+\$?)$/);
69($host) || usage("Invalid host: $opt_H\n"); 69($host) || usage("Invalid host: $opt_H\n");
70 70
71($opt_s) || ($opt_s = shift) || usage("Share volume not specified\n"); 71($opt_s) || ($opt_s = shift @ARGV) || usage("Share volume not specified\n");
72my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9]+\$?)$/); 72my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9]+\$?)$/);
73($share) || usage("Invalid share: $opt_s\n"); 73($share) || usage("Invalid share: $opt_s\n");
74 74
75($opt_u) || ($opt_u = shift) || ($opt_u = "guest"); 75($opt_u) || ($opt_u = shift @ARGV) || ($opt_u = "guest");
76my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]+)$/); 76my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]+)$/);
77($user) || usage("Invalid user: $opt_u\n"); 77($user) || usage("Invalid user: $opt_u\n");
78 78
79($opt_p) || ($opt_p = shift) || ($opt_p = ""); 79($opt_p) || ($opt_p = shift @ARGV) || ($opt_p = "");
80my $pass = $1 if ($opt_p =~ /(.*)/); 80my $pass = $1 if ($opt_p =~ /(.*)/);
81$pass = "-N" if ($opt_p eq ""); 81$pass = "-N" if ($opt_p eq "");
82 82
83($opt_w) || ($opt_w = shift) || ($opt_w = 85); 83($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 85);
84my $warn = $1 if ($opt_w =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/); 84my $warn = $1 if ($opt_w =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/);
85($warn) || usage("Invalid warning threshold: $opt_w\n"); 85($warn) || usage("Invalid warning threshold: $opt_w\n");
86 86
87($opt_c) || ($opt_c = shift) || ($opt_c = 95); 87($opt_c) || ($opt_c = shift @ARGV) || ($opt_c = 95);
88my $crit = $1 if ($opt_c =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/); 88my $crit = $1 if ($opt_c =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/);
89($crit) || usage("Invalid critical threshold: $opt_c\n"); 89($crit) || usage("Invalid critical threshold: $opt_c\n");
90 90