diff options
Diffstat (limited to 'plugins-scripts/check_rpc.pl')
-rwxr-xr-x | plugins-scripts/check_rpc.pl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl index d2701e95..cbdeceb4 100755 --- a/plugins-scripts/check_rpc.pl +++ b/plugins-scripts/check_rpc.pl | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/usr/local/bin/perl -w | 1 | #!@PERL@ -w |
2 | # | 2 | # |
3 | # check_rpc plugin for nagios | 3 | # check_rpc plugin for monitoring |
4 | # | 4 | # |
5 | # usage: | 5 | # usage: |
6 | # check_rpc host service | 6 | # check_rpc host service |
@@ -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); |
@@ -36,9 +37,9 @@ sub print_help (); | |||
36 | sub print_usage (); | 37 | sub print_usage (); |
37 | sub in ($$); | 38 | sub in ($$); |
38 | 39 | ||
39 | $ENV{'BASH_ENV'}=''; | 40 | $ENV{'PATH'}='@TRUSTED_PATH@'; |
41 | $ENV{'BASH_ENV'}=''; | ||
40 | $ENV{'ENV'}=''; | 42 | $ENV{'ENV'}=''; |
41 | $ENV{'PATH'}=''; | ||
42 | $ENV{'LC_ALL'}='C'; | 43 | $ENV{'LC_ALL'}='C'; |
43 | 44 | ||
44 | #Initialise protocol for each progname number | 45 | #Initialise protocol for each progname number |
@@ -254,7 +255,7 @@ $proto = 't' if ($opt_t); | |||
254 | $proto = 'u' if ($opt_u); | 255 | $proto = 'u' if ($opt_u); |
255 | 256 | ||
256 | 257 | ||
257 | # Just in case of problems, let's not hang Nagios | 258 | # Just in case of problems, let's not hang the monitoring system |
258 | $SIG{'ALRM'} = sub { | 259 | $SIG{'ALRM'} = sub { |
259 | print ("ERROR: No response from RPC server (alarm)\n"); | 260 | print ("ERROR: No response from RPC server (alarm)\n"); |
260 | exit $ERRORS{"UNKNOWN"}; | 261 | exit $ERRORS{"UNKNOWN"}; |