summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeni Golov <evgeni@golov.de>2014-02-26 07:07:10 (GMT)
committerJan Wagner <waja@cyconet.org>2014-02-27 19:56:50 (GMT)
commit9408c975fe199c4ef4d662dee05f4f684167b731 (patch)
treef6c0cd753b6ed0ed61bd3f9731c718beb56a8e4d
parentdd1848ef300964fc73bfd983de22b17419dbb54f (diff)
downloadmonitoring-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-xplugins-scripts/check_breeze.pl3
-rwxr-xr-xplugins-scripts/check_disk_smb.pl3
-rwxr-xr-xplugins-scripts/check_flexlm.pl3
-rwxr-xr-xplugins-scripts/check_ifoperstatus.pl3
-rwxr-xr-xplugins-scripts/check_ifstatus.pl3
-rwxr-xr-xplugins-scripts/check_ircd.pl3
-rwxr-xr-xplugins-scripts/check_mailq.pl3
-rwxr-xr-xplugins-scripts/check_netdns.pl3
-rwxr-xr-xplugins-scripts/check_rpc.pl3
-rwxr-xr-xplugins-scripts/check_wave.pl3
10 files changed, 20 insertions, 10 deletions
diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl
index a4e8542..5ff4fcf 100755
--- a/plugins-scripts/check_breeze.pl
+++ b/plugins-scripts/check_breeze.pl
@@ -4,7 +4,8 @@
4use strict; 4use strict;
5use Getopt::Long; 5use Getopt::Long;
6use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME); 6use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME);
7use lib utils.pm ; 7use FindBin;
8use lib "$FindBin::Bin";
8use utils qw(%ERRORS &print_revision &support &usage); 9use 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 8b6cd2e..b0a6114 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -24,7 +24,8 @@ use strict;
24use Getopt::Long; 24use Getopt::Long;
25use 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); 25use 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);
26use vars qw($PROGNAME); 26use vars qw($PROGNAME);
27use lib utils.pm ; 27use FindBin;
28use lib "$FindBin::Bin";
28use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 29use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
29 30
30sub print_help (); 31sub print_help ();
diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl
index 574c1cc..a0b007f 100755
--- a/plugins-scripts/check_flexlm.pl
+++ b/plugins-scripts/check_flexlm.pl
@@ -35,7 +35,8 @@
35use strict; 35use strict;
36use Getopt::Long; 36use Getopt::Long;
37use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME); 37use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME);
38use lib utils.pm; 38use FindBin;
39use lib "$FindBin::Bin";
39use utils qw(%ERRORS &print_revision &support &usage); 40use 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 a431cf3..26fae76 100755
--- a/plugins-scripts/check_ifoperstatus.pl
+++ b/plugins-scripts/check_ifoperstatus.pl
@@ -35,7 +35,8 @@
35 35
36use POSIX; 36use POSIX;
37use strict; 37use strict;
38use lib utils.pm ; 38use FindBin;
39use lib "$FindBin::Bin";
39use utils qw($TIMEOUT %ERRORS &print_revision &support); 40use utils qw($TIMEOUT %ERRORS &print_revision &support);
40 41
41use Net::SNMP; 42use Net::SNMP;
diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl
index b8faada..588e5df 100755
--- a/plugins-scripts/check_ifstatus.pl
+++ b/plugins-scripts/check_ifstatus.pl
@@ -32,7 +32,8 @@
32 32
33use POSIX; 33use POSIX;
34use strict; 34use strict;
35use lib utils.pm ; 35use FindBin;
36use lib "$FindBin::Bin";
36use utils qw($TIMEOUT %ERRORS &print_revision &support); 37use utils qw($TIMEOUT %ERRORS &print_revision &support);
37 38
38use Net::SNMP; 39use Net::SNMP;
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
index 7612a0e..e45e9fc 100755
--- a/plugins-scripts/check_ircd.pl
+++ b/plugins-scripts/check_ircd.pl
@@ -49,7 +49,8 @@ use strict;
49use Getopt::Long; 49use Getopt::Long;
50use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose); 50use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
51use vars qw($PROGNAME); 51use vars qw($PROGNAME);
52use lib utils.pm; 52use FindBin;
53use lib "$FindBin::Bin";
53use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 54use 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 8293e9c..a7de87b 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -31,7 +31,8 @@ use Getopt::Long;
31use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t 31use 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);
34use lib utils.pm; 34use FindBin;
35use lib "$FindBin::Bin";
35use utils qw(%ERRORS &print_revision &support &usage ); 36use 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 ecdbdb1..5b24642 100755
--- a/plugins-scripts/check_netdns.pl
+++ b/plugins-scripts/check_netdns.pl
@@ -27,7 +27,8 @@
27 27
28use Getopt::Long; 28use Getopt::Long;
29use Net::DNS; 29use Net::DNS;
30use lib utils.pm; 30use FindBin;
31use lib "$FindBin::Bin";
31use utils ; 32use utils ;
32 33
33my $PROGNAME = "check_netdns"; 34my $PROGNAME = "check_netdns";
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl
index 474067e..3a6f717 100755
--- a/plugins-scripts/check_rpc.pl
+++ b/plugins-scripts/check_rpc.pl
@@ -20,7 +20,8 @@
20# 20#
21 21
22use strict; 22use strict;
23use lib utils.pm; 23use FindBin;
24use lib "$FindBin::Bin";
24use utils qw($TIMEOUT %ERRORS &print_revision &support); 25use utils qw($TIMEOUT %ERRORS &print_revision &support);
25use vars qw($PROGNAME); 26use vars qw($PROGNAME);
26my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state); 27my ($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 2671112..b8ec3f0 100755
--- a/plugins-scripts/check_wave.pl
+++ b/plugins-scripts/check_wave.pl
@@ -3,7 +3,8 @@
3 3
4 4
5use strict; 5use strict;
6use lib utils.pm; 6use FindBin;
7use lib "$FindBin::Bin";
7use utils qw($TIMEOUT %ERRORS &print_revision &support); 8use utils qw($TIMEOUT %ERRORS &print_revision &support);
8use vars qw($PROGNAME); 9use vars qw($PROGNAME);
9use Getopt::Long; 10use Getopt::Long;