mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
utils.pm: use FindBin instead of awk to find the path to
'use lib utils.pm' is not valid Perl syntax: Bareword "utils" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52. Bareword "pm" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52. This makes it impossible to use the plugins directly from the git tree, e.g. while hacking on them. Using FindBin::Bin as the library path allows that, while preserving the original behaviour of adding the libexec path when the plugin is properly installed.
This commit is contained in:
parent
dd1848ef30
commit
9408c975fe
10 changed files with 20 additions and 10 deletions
|
|
@ -4,7 +4,8 @@
|
|||
use strict;
|
||||
use Getopt::Long;
|
||||
use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME);
|
||||
use lib utils.pm ;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw(%ERRORS &print_revision &support &usage);
|
||||
|
||||
$PROGNAME = "check_breeze";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ use strict;
|
|||
use Getopt::Long;
|
||||
use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $verbose);
|
||||
use vars qw($PROGNAME);
|
||||
use lib utils.pm ;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
|
||||
|
||||
sub print_help ();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@
|
|||
use strict;
|
||||
use Getopt::Long;
|
||||
use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME);
|
||||
use lib utils.pm;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw(%ERRORS &print_revision &support &usage);
|
||||
|
||||
$PROGNAME="check_flexlm";
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@
|
|||
|
||||
use POSIX;
|
||||
use strict;
|
||||
use lib utils.pm ;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support);
|
||||
|
||||
use Net::SNMP;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@
|
|||
|
||||
use POSIX;
|
||||
use strict;
|
||||
use lib utils.pm ;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support);
|
||||
|
||||
use Net::SNMP;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ use strict;
|
|||
use Getopt::Long;
|
||||
use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
|
||||
use vars qw($PROGNAME);
|
||||
use lib utils.pm;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
|
||||
|
||||
# ----------------------------------------------------[ Function Prototypes ]--
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ use Getopt::Long;
|
|||
use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t
|
||||
$opt_M $mailq $status $state $msg $msg_q $msg_p $opt_W $opt_C $mailq @lines
|
||||
%srcdomains %dstdomains);
|
||||
use lib utils.pm;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw(%ERRORS &print_revision &support &usage );
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@
|
|||
|
||||
use Getopt::Long;
|
||||
use Net::DNS;
|
||||
use lib utils.pm;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils ;
|
||||
|
||||
my $PROGNAME = "check_netdns";
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@
|
|||
#
|
||||
|
||||
use strict;
|
||||
use lib utils.pm;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support);
|
||||
use vars qw($PROGNAME);
|
||||
my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
|
||||
use strict;
|
||||
use lib utils.pm;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support);
|
||||
use vars qw($PROGNAME);
|
||||
use Getopt::Long;
|
||||
|
|
|
|||
Loading…
Reference in a new issue