From: Subhendu Ghosh Date: Mon, 27 May 2002 01:55:41 +0000 (+0000) Subject: ePN fix and support for utils.pm X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=12503c81fafff406a4f5874255b0d5e79af8951f;p=nagiosplug.git 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 --- diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 9a66ed5..bdfcf26 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 [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