diff options
author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2022-07-03 16:01:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-03 16:01:39 +0200 |
commit | b82a1667fe5c063bc9a174a76c665b27bf34b117 (patch) | |
tree | 9e86e5f1e1d9448a99d8d1d1e7837896f40d4f90 /plugins-scripts | |
parent | 059de06c51996146695166c1bf8ba3f87b6089d0 (diff) | |
parent | 175e43133c9dbeb156e52b8e54cd04e44401f424 (diff) | |
download | monitoring-plugins-b82a1667fe5c063bc9a174a76c665b27bf34b117.tar.gz |
Merge branch 'master' into check_load-compiler_warnings
Diffstat (limited to 'plugins-scripts')
-rw-r--r--[-rwxr-xr-x] | plugins-scripts/check_disk_smb.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index ad71e6a2..15d16340 100755..100644 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl | |||
@@ -22,7 +22,7 @@ require 5.004; | |||
22 | use POSIX qw(setsid); | 22 | use POSIX qw(setsid); |
23 | use strict; | 23 | 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 $opt_C $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 $opt_C $opt_t $verbose); |
26 | use vars qw($PROGNAME); | 26 | use vars qw($PROGNAME); |
27 | use FindBin; | 27 | use FindBin; |
28 | use lib "$FindBin::Bin"; | 28 | use lib "$FindBin::Bin"; |
@@ -43,6 +43,7 @@ $ENV{'ENV'}=''; | |||
43 | Getopt::Long::Configure('bundling'); | 43 | Getopt::Long::Configure('bundling'); |
44 | GetOptions | 44 | GetOptions |
45 | ("v" => \$verbose, "verbose" => \$verbose, | 45 | ("v" => \$verbose, "verbose" => \$verbose, |
46 | "t=i" => \$opt_t, "timeout=i" => \$opt_t, | ||
46 | "P=s" => \$opt_P, "port=s" => \$opt_P, | 47 | "P=s" => \$opt_P, "port=s" => \$opt_P, |
47 | "V" => \$opt_V, "version" => \$opt_V, | 48 | "V" => \$opt_V, "version" => \$opt_V, |
48 | "h" => \$opt_h, "help" => \$opt_h, | 49 | "h" => \$opt_h, "help" => \$opt_h, |
@@ -96,6 +97,8 @@ my $crit = $1 if ($opt_c =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/); | |||
96 | my $configfile = $opt_C if ($opt_C); | 97 | my $configfile = $opt_C if ($opt_C); |
97 | usage("Unable to read config file $configfile\n") if ($configfile) && (! -r $configfile); | 98 | usage("Unable to read config file $configfile\n") if ($configfile) && (! -r $configfile); |
98 | 99 | ||
100 | if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; } | ||
101 | |||
99 | # Execute the given command line and return anything it writes to STDOUT and/or | 102 | # Execute the given command line and return anything it writes to STDOUT and/or |
100 | # STDERR. (This might be useful for other plugins, too, so it should possibly | 103 | # STDERR. (This might be useful for other plugins, too, so it should possibly |
101 | # be moved to utils.pm.) | 104 | # be moved to utils.pm.) |
@@ -298,7 +301,8 @@ exit $ERRORS{$state}; | |||
298 | 301 | ||
299 | sub print_usage () { | 302 | sub print_usage () { |
300 | print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password> | 303 | print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password> |
301 | -w <warn> -c <crit> [-W <workgroup>] [-P <port>] [-a <IP>] [-C <configfile>]\n"; | 304 | -w <warn> -c <crit> [-W <workgroup>] [-P <port>] [-a <IP>] [-t timeout] |
305 | [-C <configfile>]\n"; | ||
302 | } | 306 | } |
303 | 307 | ||
304 | sub print_help () { | 308 | sub print_help () { |
@@ -326,6 +330,8 @@ Perl Check SMB Disk plugin for monitoring | |||
326 | Percent of used space at which a warning will be generated (Default: 85%) | 330 | Percent of used space at which a warning will be generated (Default: 85%) |
327 | -c, --critical=INTEGER or INTEGER[kMG] | 331 | -c, --critical=INTEGER or INTEGER[kMG] |
328 | Percent of used space at which a critical will be generated (Defaults: 95%) | 332 | Percent of used space at which a critical will be generated (Defaults: 95%) |
333 | -t, --timeout=INTEGER | ||
334 | Seconds before connection times out (Default: 15) | ||
329 | -P, --port=INTEGER | 335 | -P, --port=INTEGER |
330 | Port to be used to connect to. Some Windows boxes use 139, others 445 (Defaults to smbclient default) | 336 | Port to be used to connect to. Some Windows boxes use 139, others 445 (Defaults to smbclient default) |
331 | -C, --configfile=STRING | 337 | -C, --configfile=STRING |