diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-09-15 14:26:54 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-09-15 14:26:54 +0000 |
commit | b7591825d4e3fae343e637acaf2e4f5e41effc8e (patch) | |
tree | 039e03a44a29921285c68c28d777d8fbc7d739b3 | |
parent | 790f2cfd04bec7e3680f32ee5f3d5120814d2983 (diff) | |
download | monitoring-plugins-b7591825d4e3fae343e637acaf2e4f5e41effc8e.tar.gz |
Optionally specify port for smbclient to use (781227 - Jason Burnett)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@723 f882894a-f735-0410-b71e-b25c423dba1c
-rwxr-xr-x | plugins-scripts/check_disk_smb.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index b4eee38b..3358f6a1 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) |