summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_rpc.pl
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts/check_rpc.pl')
-rwxr-xr-xplugins-scripts/check_rpc.pl13
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
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);
@@ -36,9 +37,9 @@ sub print_help ();
36sub print_usage (); 37sub print_usage ();
37sub in ($$); 38sub 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"};