summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_disk_smb.pl9
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;
23use POSIX; 23use POSIX;
24use strict; 24use strict;
25use Getopt::Long; 25use Getopt::Long;
26use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose); 26use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose);
27use vars qw($PROGNAME); 27use vars qw($PROGNAME);
28use lib utils.pm ; 28use lib utils.pm ;
29use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 29use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
@@ -40,6 +40,7 @@ $ENV{'ENV'}='';
40Getopt::Long::Configure('bundling'); 40Getopt::Long::Configure('bundling');
41GetOptions 41GetOptions
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) {
58if ($opt_h) {print_help(); exit $ERRORS{'OK'};} 59if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
59 60
60my $smbclient= "$utils::PATH_TO_SMBCLIENT " ; 61my $smbclient= "$utils::PATH_TO_SMBCLIENT " ;
61my $smbclientoptions=""; 62my $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
231sub print_usage () { 232sub 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
236sub print_help () { 237sub 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)