diff options
Diffstat (limited to 'plugins-scripts/check_flexlm.pl')
-rwxr-xr-x | plugins-scripts/check_flexlm.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl index 54d933c7..49d674d4 100755 --- a/plugins-scripts/check_flexlm.pl +++ b/plugins-scripts/check_flexlm.pl | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/perl -w | 1 | #!@PERL@ -w |
2 | # | 2 | # |
3 | # usage: | 3 | # usage: |
4 | # check_flexlm.pl license_file | 4 | # check_flexlm.pl license_file |
@@ -9,7 +9,7 @@ | |||
9 | # Check and interpret the output of lmstat | 9 | # Check and interpret the output of lmstat |
10 | # and create returncodes and output. | 10 | # and create returncodes and output. |
11 | # | 11 | # |
12 | # Contrary to the nagios concept, this script takes | 12 | # Contrary to most other plugins, this script takes |
13 | # a file, not a hostname as an argument and returns | 13 | # a file, not a hostname as an argument and returns |
14 | # the status of hosts and services described in that | 14 | # the status of hosts and services described in that |
15 | # file. Use these hosts.cfg entries as an example | 15 | # file. Use these hosts.cfg entries as an example |
@@ -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"; |
@@ -43,7 +44,7 @@ $PROGNAME="check_flexlm"; | |||
43 | sub print_help (); | 44 | sub print_help (); |
44 | sub print_usage (); | 45 | sub print_usage (); |
45 | 46 | ||
46 | $ENV{'PATH'}=''; | 47 | $ENV{'PATH'}='@TRUSTED_PATH@'; |
47 | $ENV{'BASH_ENV'}=''; | 48 | $ENV{'BASH_ENV'}=''; |
48 | $ENV{'ENV'}=''; | 49 | $ENV{'ENV'}=''; |
49 | 50 | ||
@@ -72,7 +73,7 @@ unless (defined $opt_F) { | |||
72 | print_usage(); | 73 | print_usage(); |
73 | exit $ERRORS{'UNKNOWN'}; | 74 | exit $ERRORS{'UNKNOWN'}; |
74 | } | 75 | } |
75 | # Just in case of problems, let's not hang Nagios | 76 | # Just in case of problems, let's not hang the monitoring system |
76 | $SIG{'ALRM'} = sub { | 77 | $SIG{'ALRM'} = sub { |
77 | print "Timeout: No Answer from Client\n"; | 78 | print "Timeout: No Answer from Client\n"; |
78 | exit $ERRORS{'UNKNOWN'}; | 79 | exit $ERRORS{'UNKNOWN'}; |