diff options
Diffstat (limited to 'plugins-scripts/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index b4eee38..3358f6a 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl | |||
@@ -23,7 +23,7 @@ require 5.004; | |||
23 | use POSIX; | 23 | use POSIX; |
24 | use strict; | 24 | use strict; |
25 | use Getopt::Long; | 25 | use Getopt::Long; |
26 | use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose); | 26 | use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose); |
27 | use vars qw($PROGNAME); | 27 | use vars qw($PROGNAME); |
28 | use lib utils.pm ; | 28 | use lib utils.pm ; |
29 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); | 29 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); |
@@ -40,6 +40,7 @@ $ENV{'ENV'}=''; | |||
40 | Getopt::Long::Configure('bundling'); | 40 | Getopt::Long::Configure('bundling'); |
41 | GetOptions | 41 | GetOptions |
42 | ("v" => \$verbose, "verbose" => \$verbose, | 42 | ("v" => \$verbose, "verbose" => \$verbose, |
43 | "P=s" => \$opt_P, "port=s" => \$opt_P, | ||
43 | "V" => \$opt_V, "version" => \$opt_V, | 44 | "V" => \$opt_V, "version" => \$opt_V, |
44 | "h" => \$opt_h, "help" => \$opt_h, | 45 | "h" => \$opt_h, "help" => \$opt_h, |
45 | "w=s" => \$opt_w, "warning=s" => \$opt_w, | 46 | "w=s" => \$opt_w, "warning=s" => \$opt_w, |
@@ -58,7 +59,7 @@ if ($opt_V) { | |||
58 | if ($opt_h) {print_help(); exit $ERRORS{'OK'};} | 59 | if ($opt_h) {print_help(); exit $ERRORS{'OK'};} |
59 | 60 | ||
60 | my $smbclient= "$utils::PATH_TO_SMBCLIENT " ; | 61 | my $smbclient= "$utils::PATH_TO_SMBCLIENT " ; |
61 | my $smbclientoptions=""; | 62 | my $smbclientoptions= $opt_P ? "-p $opt_P " : ""; |
62 | 63 | ||
63 | 64 | ||
64 | # Options checking | 65 | # Options checking |
@@ -230,7 +231,7 @@ exit $ERRORS{$state}; | |||
230 | 231 | ||
231 | sub print_usage () { | 232 | sub print_usage () { |
232 | print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password> | 233 | print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password> |
233 | -w <warn> -c <crit> [-W <workgroup>]\n"; | 234 | -w <warn> -c <crit> [-W <workgroup>] [-P <port>]\n"; |
234 | } | 235 | } |
235 | 236 | ||
236 | sub print_help () { | 237 | sub print_help () { |
@@ -257,6 +258,8 @@ Perl Check SMB Disk plugin for Nagios | |||
257 | 258 | ||
258 | -c, --critical=INTEGER or INTEGER[kMG] | 259 | -c, --critical=INTEGER or INTEGER[kMG] |
259 | Percent of used space at which a critical will be generated (Defaults: 95%) | 260 | Percent of used space at which a critical will be generated (Defaults: 95%) |
261 | -P, --port=INTEGER | ||
262 | Port to be used to connect to. Some Windows boxes use 139, others 445 (Defaults to smbclient default) | ||
260 | 263 | ||
261 | If thresholds are followed by either a k, M, or G then check to see if that | 264 | If thresholds are followed by either a k, M, or G then check to see if that |
262 | much disk space is available (kilobytes, Megabytes, Gigabytes) | 265 | much disk space is available (kilobytes, Megabytes, Gigabytes) |