diff options
Diffstat (limited to 'plugins-scripts/check_disk_smb.pl')
-rwxr-xr-x | plugins-scripts/check_disk_smb.pl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 0c89db57..99948a41 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl | |||
@@ -1,9 +1,9 @@ | |||
1 | #!/usr/bin/perl -w | 1 | #!@PERL@ -w |
2 | # | 2 | # |
3 | # | 3 | # |
4 | # check_disk.pl <host> <share> <user> <pass> [warn] [critical] [port] | 4 | # check_disk.pl <host> <share> <user> <pass> [warn] [critical] [port] |
5 | # | 5 | # |
6 | # Nagios host script to get the disk usage from a SMB share | 6 | # Monitoring host script to get the disk usage from a SMB share |
7 | # | 7 | # |
8 | # Changes and Modifications | 8 | # Changes and Modifications |
9 | # ========================= | 9 | # ========================= |
@@ -24,7 +24,8 @@ use strict; | |||
24 | use Getopt::Long; | 24 | use Getopt::Long; |
25 | use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $verbose); | 25 | use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $verbose); |
26 | use vars qw($PROGNAME); | 26 | use vars qw($PROGNAME); |
27 | use lib utils.pm ; | 27 | use FindBin; |
28 | use lib "$FindBin::Bin"; | ||
28 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); | 29 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); |
29 | 30 | ||
30 | sub print_help (); | 31 | sub print_help (); |
@@ -32,7 +33,7 @@ sub print_usage (); | |||
32 | 33 | ||
33 | $PROGNAME = "check_disk_smb"; | 34 | $PROGNAME = "check_disk_smb"; |
34 | 35 | ||
35 | $ENV{'PATH'}=''; | 36 | $ENV{'PATH'}='@TRUSTED_PATH@'; |
36 | $ENV{'BASH_ENV'}=''; | 37 | $ENV{'BASH_ENV'}=''; |
37 | $ENV{'ENV'}=''; | 38 | $ENV{'ENV'}=''; |
38 | 39 | ||
@@ -171,7 +172,7 @@ my $res = undef; | |||
171 | my $perfdata = ""; | 172 | my $perfdata = ""; |
172 | my @lines = undef; | 173 | my @lines = undef; |
173 | 174 | ||
174 | # Just in case of problems, let's not hang Nagios | 175 | # Just in case of problems, let's not hang the monitoring system |
175 | $SIG{'ALRM'} = sub { | 176 | $SIG{'ALRM'} = sub { |
176 | print "No Answer from Client\n"; | 177 | print "No Answer from Client\n"; |
177 | exit $ERRORS{"UNKNOWN"}; | 178 | exit $ERRORS{"UNKNOWN"}; |
@@ -293,7 +294,7 @@ sub print_help () { | |||
293 | print_revision($PROGNAME,'@NP_VERSION@'); | 294 | print_revision($PROGNAME,'@NP_VERSION@'); |
294 | print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop | 295 | print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop |
295 | 296 | ||
296 | Perl Check SMB Disk plugin for Nagios | 297 | Perl Check SMB Disk plugin for monitoring |
297 | 298 | ||
298 | "; | 299 | "; |
299 | print_usage(); | 300 | print_usage(); |