[Nagiosplug-devel] check_Disk_smp patch against 1.3.1

Jason Martin jhmartin at toger.us
Tue Jun 1 10:10:04 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The attached patch against check_disk_smb from the 1.3.1 release adds a 
check that the smbclient binary actually exists before attempting to 
execute it.

- -Jason Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.5 (GNU/Linux)
Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/

iD8DBQFAvLhPl2ODWuqVSBMRAnV/AJ4gUmFYmqKmZJvy+hfF1mqcUCF2HwCeKlab
o5uKqWSrZnJE/XKzkW6tnGE=
=ISCP
-----END PGP SIGNATURE-----
-------------- next part --------------
--- check_disk_smb.pl	Thu Jul 10 23:03:49 2003
+++ /home/nagios/plugins_build/nagios-plugins-1.3.1/plugins-scripts/aws_check_disk_smb.pl	Thu Feb 26 12:29:26 2004
@@ -16,7 +16,7 @@
 #  drives is a pain in the butt
 # 2-May-2002 - SGhosh fix for embedded perl
 #
-# $Id: check_disk_smb.pl,v 1.8.2.1 2003/07/02 15:52:23 tonvoon Exp $
+# $Id: aws_check_disk_smb.pl,v 1.1.1.1 2004/02/26 20:29:26 nagios Exp $
 #
 
 require 5.004;
@@ -31,7 +31,7 @@
 sub print_help ();
 sub print_usage ();
 
-$PROGNAME = "check_disk_smb";
+$PROGNAME = "aws_check_disk_smb";
 
 $ENV{'PATH'}='';
 $ENV{'BASH_ENV'}=''; 
@@ -51,13 +51,17 @@
 	 "H=s" => \$opt_H, "hostname=s" => \$opt_H);
 
 if ($opt_V) {
-	print_revision($PROGNAME,'$Revision: 1.8.2.1 $'); #'
+	print_revision($PROGNAME,'$Revision: 1.1.1.1 $'); #'
 	exit $ERRORS{'OK'};
 }
 
 if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
 
 my $smbclient= "$utils::PATH_TO_SMBCLIENT " ;
+if ( ! -x $smbclient ) { 
+    print "Unable to locate smbclient: $smbclient\n";
+    exit $ERRORS{"UNKNOWN"};
+}
 my $smbclientoptions="";
 
 
@@ -234,7 +238,7 @@
 }
 
 sub print_help () {
-	print_revision($PROGNAME,'$Revision: 1.8.2.1 $');
+	print_revision($PROGNAME,'$Revision: 1.1.1.1 $');
 	print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop
 
 Perl Check SMB Disk plugin for Nagios


More information about the Devel mailing list