aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_disk_smb.pl
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-09-15 14:26:54 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-09-15 14:26:54 +0000
commitb7591825d4e3fae343e637acaf2e4f5e41effc8e (patch)
tree039e03a44a29921285c68c28d777d8fbc7d739b3 /plugins-scripts/check_disk_smb.pl
parent790f2cfd04bec7e3680f32ee5f3d5120814d2983 (diff)
downloadmonitoring-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
Diffstat (limited to 'plugins-scripts/check_disk_smb.pl')
-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;
use POSIX;
use strict;
use Getopt::Long;
-use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose);
+use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose);
use vars qw($PROGNAME);
use lib utils.pm ;
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
@@ -40,6 +40,7 @@ $ENV{'ENV'}='';
Getopt::Long::Configure('bundling');
GetOptions
("v" => \$verbose, "verbose" => \$verbose,
+ "P=s" => \$opt_P, "port=s" => \$opt_P,
"V" => \$opt_V, "version" => \$opt_V,
"h" => \$opt_h, "help" => \$opt_h,
"w=s" => \$opt_w, "warning=s" => \$opt_w,
@@ -58,7 +59,7 @@ if ($opt_V) {
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
my $smbclient= "$utils::PATH_TO_SMBCLIENT " ;
-my $smbclientoptions="";
+my $smbclientoptions= $opt_P ? "-p $opt_P " : "";
# Options checking
@@ -230,7 +231,7 @@ exit $ERRORS{$state};
sub print_usage () {
print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password>
- -w <warn> -c <crit> [-W <workgroup>]\n";
+ -w <warn> -c <crit> [-W <workgroup>] [-P <port>]\n";
}
sub print_help () {
@@ -257,6 +258,8 @@ Perl Check SMB Disk plugin for Nagios
-c, --critical=INTEGER or INTEGER[kMG]
Percent of used space at which a critical will be generated (Defaults: 95%)
+-P, --port=INTEGER
+ Port to be used to connect to. Some Windows boxes use 139, others 445 (Defaults to smbclient default)
If thresholds are followed by either a k, M, or G then check to see if that
much disk space is available (kilobytes, Megabytes, Gigabytes)