Code

ePN fix and support for utils.pm
authorSubhendu Ghosh <sghosh@users.sourceforge.net>
Mon, 27 May 2002 01:55:41 +0000 (01:55 +0000)
committerSubhendu 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

index 9a66ed5dd55b897d587a0d25a0ce636243844dd2..bdfcf2678620cae49e99f9b49e641cbd33283ed7 100755 (executable)
@@ -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