summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_mssql.pl
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts/check_mssql.pl')
-rwxr-xr-xplugins-scripts/check_mssql.pl15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins-scripts/check_mssql.pl b/plugins-scripts/check_mssql.pl
index 9a8fc51..a436a8f 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 @@
29use DBI; 29use DBI;
30use DBD::Sybase; 30use DBD::Sybase;
31use Getopt::Long; 31use Getopt::Long;
32use lib "."; 32use FindBin;
33use lib "$FindBin::Bin";
33use utils qw($TIMEOUT %ERRORS &print_revision &support); 34use utils qw($TIMEOUT %ERRORS &print_revision &support);
34use strict; 35use strict;
35 36
36my $PROGNAME = "check_mssql"; 37my $PROGNAME = "check_mssql";
37 38
39$ENV{'PATH'}='@TRUSTED_PATH@';
40$ENV{'BASH_ENV'}='';
41$ENV{'ENV'}='';
42
38my ( 43my (
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
45process_arguments(); 50process_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"};