diff options
Diffstat (limited to 'plugins-scripts/check_mssql.pl')
-rwxr-xr-x | plugins-scripts/check_mssql.pl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins-scripts/check_mssql.pl b/plugins-scripts/check_mssql.pl index 9a8fc511..a436a8ff 100755 --- a/plugins-scripts/check_mssql.pl +++ b/plugins-scripts/check_mssql.pl | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/perl -w | 1 | #!@PERL@ -w |
2 | 2 | ||
3 | # | 3 | # |
4 | # Copyright 2003 Roy Sigurd Karlsbakk | 4 | # Copyright 2003 Roy Sigurd Karlsbakk |
@@ -19,9 +19,9 @@ | |||
19 | # | 19 | # |
20 | # You should have received a copy of the GNU General Public License | 20 | # You should have received a copy of the GNU General Public License |
21 | # along with this program; if not, write to the Free Software | 21 | # along with this program; if not, write to the Free Software |
22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 22 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. |
23 | # | 23 | # |
24 | # Report bugs to: nagiosplug-help@lists.sourceforge.net | 24 | # Report bugs to: help@monitoring-plugins.org |
25 | # | 25 | # |
26 | # | 26 | # |
27 | 27 | ||
@@ -29,12 +29,17 @@ | |||
29 | use DBI; | 29 | use DBI; |
30 | use DBD::Sybase; | 30 | use DBD::Sybase; |
31 | use Getopt::Long; | 31 | use Getopt::Long; |
32 | use lib "."; | 32 | use FindBin; |
33 | use lib "$FindBin::Bin"; | ||
33 | use utils qw($TIMEOUT %ERRORS &print_revision &support); | 34 | use utils qw($TIMEOUT %ERRORS &print_revision &support); |
34 | use strict; | 35 | use strict; |
35 | 36 | ||
36 | my $PROGNAME = "check_mssql"; | 37 | my $PROGNAME = "check_mssql"; |
37 | 38 | ||
39 | $ENV{'PATH'}='@TRUSTED_PATH@'; | ||
40 | $ENV{'BASH_ENV'}=''; | ||
41 | $ENV{'ENV'}=''; | ||
42 | |||
38 | my ( | 43 | my ( |
39 | $server,$database,$username,$password,$query,$help,$verbose,$timeout, | 44 | $server,$database,$username,$password,$query,$help,$verbose,$timeout, |
40 | $dbh,$sth,$row, | 45 | $dbh,$sth,$row, |
@@ -44,7 +49,7 @@ my $exitcode = $ERRORS{'OK'}; | |||
44 | 49 | ||
45 | process_arguments(); | 50 | process_arguments(); |
46 | 51 | ||
47 | # Just in case of problems, let's not hang Nagios | 52 | # Just in case of problems, let's not hang the monitoring system |
48 | $SIG{'ALRM'} = sub { | 53 | $SIG{'ALRM'} = sub { |
49 | print ("SQL UNKNOWN: ERROR connection $server (alarm timeout)\n"); | 54 | print ("SQL UNKNOWN: ERROR connection $server (alarm timeout)\n"); |
50 | exit $ERRORS{"UNKNOWN"}; | 55 | exit $ERRORS{"UNKNOWN"}; |