summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d266020)
raw | patch | inline | side by side (parent: d266020)
author | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Mon, 27 May 2002 01:55:41 +0000 (01:55 +0000) | ||
committer | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Mon, 27 May 2002 01:55:41 +0000 (01:55 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@34 f882894a-f735-0410-b71e-b25c423dba1c
plugins-scripts/check_disk_smb.pl | patch | blob | history |
index 9a66ed5dd55b897d587a0d25a0ce636243844dd2..bdfcf2678620cae49e99f9b49e641cbd33283ed7 100755 (executable)
-#! /usr/bin/perl -wT
+#! /usr/bin/perl -w
#
#
# check_disk.pl <host> <share> <user> <pass> [warn] [critical] [port]
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'}='';
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");
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