diff options
author | Evgeni Golov <evgeni@golov.de> | 2014-02-26 08:07:10 +0100 |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2014-02-27 20:56:50 +0100 |
commit | 9408c975fe199c4ef4d662dee05f4f684167b731 (patch) | |
tree | f6c0cd753b6ed0ed61bd3f9731c718beb56a8e4d | |
parent | dd1848ef300964fc73bfd983de22b17419dbb54f (diff) | |
download | monitoring-plugins-9408c97.tar.gz |
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.
-rwxr-xr-x | plugins-scripts/check_breeze.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_disk_smb.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_flexlm.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_ifoperstatus.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_ifstatus.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_ircd.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_mailq.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_netdns.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_rpc.pl | 3 | ||||
-rwxr-xr-x | plugins-scripts/check_wave.pl | 3 |
10 files changed, 20 insertions, 10 deletions
diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl index a4e8542c..5ff4fcfa 100755 --- a/plugins-scripts/check_breeze.pl +++ b/plugins-scripts/check_breeze.pl | |||
@@ -4,7 +4,8 @@ | |||
4 | use strict; | 4 | use strict; |
5 | use Getopt::Long; | 5 | use Getopt::Long; |
6 | use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME); | 6 | use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME); |
7 | use lib utils.pm ; | 7 | use FindBin; |
8 | use lib "$FindBin::Bin"; | ||
8 | use utils qw(%ERRORS &print_revision &support &usage); | 9 | use utils qw(%ERRORS &print_revision &support &usage); |
9 | 10 | ||
10 | $PROGNAME = "check_breeze"; | 11 | $PROGNAME = "check_breeze"; |
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 8b6cd2eb..b0a61144 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl | |||
@@ -24,7 +24,8 @@ use strict; | |||
24 | use Getopt::Long; | 24 | use Getopt::Long; |
25 | 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); | 25 | 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); |
26 | use vars qw($PROGNAME); | 26 | use vars qw($PROGNAME); |
27 | use lib utils.pm ; | 27 | use FindBin; |
28 | use lib "$FindBin::Bin"; | ||
28 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); | 29 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); |
29 | 30 | ||
30 | sub print_help (); | 31 | sub print_help (); |
diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl index 574c1ccf..a0b007fb 100755 --- a/plugins-scripts/check_flexlm.pl +++ b/plugins-scripts/check_flexlm.pl | |||
@@ -35,7 +35,8 @@ | |||
35 | use strict; | 35 | use strict; |
36 | use Getopt::Long; | 36 | use Getopt::Long; |
37 | use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME); | 37 | use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME); |
38 | use lib utils.pm; | 38 | use FindBin; |
39 | use lib "$FindBin::Bin"; | ||
39 | use utils qw(%ERRORS &print_revision &support &usage); | 40 | use utils qw(%ERRORS &print_revision &support &usage); |
40 | 41 | ||
41 | $PROGNAME="check_flexlm"; | 42 | $PROGNAME="check_flexlm"; |
diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl index a431cf37..26fae76d 100755 --- a/plugins-scripts/check_ifoperstatus.pl +++ b/plugins-scripts/check_ifoperstatus.pl | |||
@@ -35,7 +35,8 @@ | |||
35 | 35 | ||
36 | use POSIX; | 36 | use POSIX; |
37 | use strict; | 37 | use strict; |
38 | use lib utils.pm ; | 38 | use FindBin; |
39 | use lib "$FindBin::Bin"; | ||
39 | use utils qw($TIMEOUT %ERRORS &print_revision &support); | 40 | use utils qw($TIMEOUT %ERRORS &print_revision &support); |
40 | 41 | ||
41 | use Net::SNMP; | 42 | use Net::SNMP; |
diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl index b8faada9..588e5df3 100755 --- a/plugins-scripts/check_ifstatus.pl +++ b/plugins-scripts/check_ifstatus.pl | |||
@@ -32,7 +32,8 @@ | |||
32 | 32 | ||
33 | use POSIX; | 33 | use POSIX; |
34 | use strict; | 34 | use strict; |
35 | use lib utils.pm ; | 35 | use FindBin; |
36 | use lib "$FindBin::Bin"; | ||
36 | use utils qw($TIMEOUT %ERRORS &print_revision &support); | 37 | use utils qw($TIMEOUT %ERRORS &print_revision &support); |
37 | 38 | ||
38 | use Net::SNMP; | 39 | use Net::SNMP; |
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl index 7612a0ef..e45e9fc1 100755 --- a/plugins-scripts/check_ircd.pl +++ b/plugins-scripts/check_ircd.pl | |||
@@ -49,7 +49,8 @@ use strict; | |||
49 | use Getopt::Long; | 49 | use Getopt::Long; |
50 | use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose); | 50 | use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose); |
51 | use vars qw($PROGNAME); | 51 | use vars qw($PROGNAME); |
52 | use lib utils.pm; | 52 | use FindBin; |
53 | use lib "$FindBin::Bin"; | ||
53 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); | 54 | use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); |
54 | 55 | ||
55 | # ----------------------------------------------------[ Function Prototypes ]-- | 56 | # ----------------------------------------------------[ Function Prototypes ]-- |
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index 8293e9c6..a7de87bf 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl | |||
@@ -31,7 +31,8 @@ use Getopt::Long; | |||
31 | use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t | 31 | use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t |
32 | $opt_M $mailq $status $state $msg $msg_q $msg_p $opt_W $opt_C $mailq @lines | 32 | $opt_M $mailq $status $state $msg $msg_q $msg_p $opt_W $opt_C $mailq @lines |
33 | %srcdomains %dstdomains); | 33 | %srcdomains %dstdomains); |
34 | use lib utils.pm; | 34 | use FindBin; |
35 | use lib "$FindBin::Bin"; | ||
35 | use utils qw(%ERRORS &print_revision &support &usage ); | 36 | use utils qw(%ERRORS &print_revision &support &usage ); |
36 | 37 | ||
37 | 38 | ||
diff --git a/plugins-scripts/check_netdns.pl b/plugins-scripts/check_netdns.pl index ecdbdb1a..5b246429 100755 --- a/plugins-scripts/check_netdns.pl +++ b/plugins-scripts/check_netdns.pl | |||
@@ -27,7 +27,8 @@ | |||
27 | 27 | ||
28 | use Getopt::Long; | 28 | use Getopt::Long; |
29 | use Net::DNS; | 29 | use Net::DNS; |
30 | use lib utils.pm; | 30 | use FindBin; |
31 | use lib "$FindBin::Bin"; | ||
31 | use utils ; | 32 | use utils ; |
32 | 33 | ||
33 | my $PROGNAME = "check_netdns"; | 34 | my $PROGNAME = "check_netdns"; |
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl index 474067e3..3a6f7179 100755 --- a/plugins-scripts/check_rpc.pl +++ b/plugins-scripts/check_rpc.pl | |||
@@ -20,7 +20,8 @@ | |||
20 | # | 20 | # |
21 | 21 | ||
22 | use strict; | 22 | use strict; |
23 | use lib utils.pm; | 23 | use FindBin; |
24 | use lib "$FindBin::Bin"; | ||
24 | use utils qw($TIMEOUT %ERRORS &print_revision &support); | 25 | use utils qw($TIMEOUT %ERRORS &print_revision &support); |
25 | use vars qw($PROGNAME); | 26 | use vars qw($PROGNAME); |
26 | my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state); | 27 | my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state); |
diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl index 2671112a..b8ec3f03 100755 --- a/plugins-scripts/check_wave.pl +++ b/plugins-scripts/check_wave.pl | |||
@@ -3,7 +3,8 @@ | |||
3 | 3 | ||
4 | 4 | ||
5 | use strict; | 5 | use strict; |
6 | use lib utils.pm; | 6 | use FindBin; |
7 | use lib "$FindBin::Bin"; | ||
7 | use utils qw($TIMEOUT %ERRORS &print_revision &support); | 8 | use utils qw($TIMEOUT %ERRORS &print_revision &support); |
8 | use vars qw($PROGNAME); | 9 | use vars qw($PROGNAME); |
9 | use Getopt::Long; | 10 | use Getopt::Long; |