aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_disk_smb.pl
diff options
context:
space:
mode:
authorGravatar Subhendu Ghosh <sghosh@users.sourceforge.net> 2002-05-27 01:55:41 +0000
committerGravatar Subhendu Ghosh <sghosh@users.sourceforge.net> 2002-05-27 01:55:41 +0000
commit12503c81fafff406a4f5874255b0d5e79af8951f (patch)
tree11c6384581ca5b6b7bd2e1827e915d24b3e181e8 /plugins-scripts/check_disk_smb.pl
parentd2660204b92714140df60768cd2f32aac94edf31 (diff)
downloadmonitoring-plugins-12503c81fafff406a4f5874255b0d5e79af8951f.tar.gz
ePN fix and support for utils.pm
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@34 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins-scripts/check_disk_smb.pl')
-rwxr-xr-xplugins-scripts/check_disk_smb.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 9a66ed5d..bdfcf267 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -wT
+#! /usr/bin/perl -w
#
#
# check_disk.pl <host> <share> <user> <pass> [warn] [critical] [port]
@@ -25,13 +25,14 @@ 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($PROGNAME);
-use FindBin;
-use lib "$FindBin::Bin";
+use lib utils.pm ;
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
sub print_help ();
sub print_usage ();
+$PROGNAME = "check_disk_smb";
+
$ENV{'PATH'}='';
$ENV{'BASH_ENV'}='';
$ENV{'ENV'}='';
@@ -56,9 +57,10 @@ if ($opt_V) {
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
-my $smbclient="/usr/bin/smbclient";
+my $smbclient= "$utils::PATH_TO_SMBCLIENT " ;
my $smbclientoptions="";
+
($opt_H) || ($opt_H = shift) || usage("Host name not specified\n");
my $host = $1 if ($opt_H =~ /([-_.A-Za-z0-9]+)/);
($host) || usage("Invalid host: $opt_H\n");
@@ -101,6 +103,7 @@ alarm($TIMEOUT);
if (defined($workgroup)) {
$res = qx/$smbclient \/\/$host\/$share $pass -W $workgroup -U $user $smbclientoptions -c ls/;
} else {
+ print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user $smbclientoptions -c ls\n" if ($verbose);
$res = qx/$smbclient \/\/$host\/$share $pass -U $user $smbclientoptions -c ls/;
}
#Turn off alarm