Преглед изворни кода

Don't rely on FindBin module to locate utils.pm

As the FindBin module doesn't work with ePN, set the path to utils.pm
explicitly at build time.  Keep using FindBin additionally, so that the
plugins can also be executed from the build directory.

Closes #1271.
Holger Weiss пре 11 година
родитељ
комит
766f4daafb

+ 2 - 1
plugins-scripts/Makefile.am

@@ -26,7 +26,8 @@ EXTRA_DIST=check_breeze.pl check_disk_smb.pl check_flexlm.pl check_ircd.pl \
 EDIT = sed \
 EDIT = sed \
   -e 's|[@]NP_VERSION[@]|$(NP_VERSION)|g' \
   -e 's|[@]NP_VERSION[@]|$(NP_VERSION)|g' \
   -e 's|[@]TRUSTED_PATH[@]|$(with_trusted_path)|g' \
   -e 's|[@]TRUSTED_PATH[@]|$(with_trusted_path)|g' \
-  -e 's|[@]PERL[@]|$(PERL)|g'
+  -e 's|[@]PERL[@]|$(PERL)|g' \
+  -e 's|[@]libexecdir[@]|$(libexecdir)|g'
 
 
 TESTS_ENVIRONMENT=perl -I $(top_builddir) -I $(top_srcdir)
 TESTS_ENVIRONMENT=perl -I $(top_builddir) -I $(top_srcdir)
 
 

+ 1 - 0
plugins-scripts/check_breeze.pl

@@ -6,6 +6,7 @@ use Getopt::Long;
 use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME);
 use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME);
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw(%ERRORS &print_revision &support &usage);
 use utils qw(%ERRORS &print_revision &support &usage);
 
 
 $PROGNAME = "check_breeze";
 $PROGNAME = "check_breeze";

+ 1 - 0
plugins-scripts/check_disk_smb.pl

@@ -26,6 +26,7 @@ use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_
 use vars qw($PROGNAME);
 use vars qw($PROGNAME);
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
 use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
 
 
 sub print_help ();
 sub print_help ();

+ 3 - 1
plugins-scripts/check_file_age.pl

@@ -26,7 +26,9 @@ use English;
 use Getopt::Long;
 use Getopt::Long;
 use File::stat;
 use File::stat;
 use vars qw($PROGNAME);
 use vars qw($PROGNAME);
-use lib ".";
+use FindBin;
+use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw (%ERRORS &print_revision &support);
 use utils qw (%ERRORS &print_revision &support);
 
 
 sub print_help ();
 sub print_help ();

+ 1 - 0
plugins-scripts/check_flexlm.pl

@@ -37,6 +37,7 @@ use Getopt::Long;
 use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME);
 use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME);
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw(%ERRORS &print_revision &support &usage);
 use utils qw(%ERRORS &print_revision &support &usage);
 
 
 $PROGNAME="check_flexlm";
 $PROGNAME="check_flexlm";

+ 1 - 0
plugins-scripts/check_ifoperstatus.pl

@@ -36,6 +36,7 @@ use POSIX;
 use strict;
 use strict;
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 
 
 use Net::SNMP;
 use Net::SNMP;

+ 1 - 0
plugins-scripts/check_ifstatus.pl

@@ -35,6 +35,7 @@ use POSIX;
 use strict;
 use strict;
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 
 
 use Net::SNMP;
 use Net::SNMP;

+ 1 - 0
plugins-scripts/check_ircd.pl

@@ -53,6 +53,7 @@ use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
 use vars qw($PROGNAME);
 use vars qw($PROGNAME);
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
 use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
 
 
 # ----------------------------------------------------[ Function Prototypes ]--
 # ----------------------------------------------------[ Function Prototypes ]--

+ 1 - 0
plugins-scripts/check_mailq.pl

@@ -33,6 +33,7 @@ use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t $opt_s
 					%srcdomains %dstdomains);
 					%srcdomains %dstdomains);
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw(%ERRORS &print_revision &support &usage );
 use utils qw(%ERRORS &print_revision &support &usage );
 
 
 my ($sudo)
 my ($sudo)

+ 3 - 1
plugins-scripts/check_mssql.pl

@@ -30,7 +30,9 @@
 use DBI;
 use DBI;
 use DBD::Sybase;
 use DBD::Sybase;
 use Getopt::Long;
 use Getopt::Long;
-use lib ".";
+use FindBin;
+use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use strict;
 use strict;
 
 

+ 1 - 0
plugins-scripts/check_netdns.pl

@@ -29,6 +29,7 @@ use Getopt::Long;
 use Net::DNS;
 use Net::DNS;
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils ;
 use utils ;
 
 
 my $PROGNAME = "check_netdns";
 my $PROGNAME = "check_netdns";

+ 1 - 0
plugins-scripts/check_rpc.pl

@@ -22,6 +22,7 @@
 use strict;
 use strict;
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use vars qw($PROGNAME);
 use vars qw($PROGNAME);
 my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state);
 my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state);

+ 1 - 0
plugins-scripts/check_wave.pl

@@ -5,6 +5,7 @@
 use strict;
 use strict;
 use FindBin;
 use FindBin;
 use lib "$FindBin::Bin";
 use lib "$FindBin::Bin";
+use lib '@libexecdir@';
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use utils qw($TIMEOUT %ERRORS &print_revision &support);
 use vars qw($PROGNAME);
 use vars qw($PROGNAME);
 use Getopt::Long;
 use Getopt::Long;