7531483ace
This release contains several enhancements, including rate calculation in check_snmp. There are also lots of bug fixes. * New check_ntp_peer -m and -n options to check the number of usable time sources ("truechimers") * New check_disk_smb -a option which allows for specifying the IP address of the remote server
56 lines
2.1 KiB
Text
56 lines
2.1 KiB
Text
$NetBSD: patch-am,v 1.2 2011/04/08 22:56:12 morr Exp $
|
|
|
|
--- contrib/check_mssql.sh.orig 2010-07-27 20:47:15.000000000 +0000
|
|
+++ contrib/check_mssql.sh
|
|
@@ -35,10 +35,10 @@ pswd=$3
|
|
srv=$4
|
|
|
|
|
|
-if [ ! "$#" == "4" ]; then
|
|
+if [ ! "$#" = "4" ]; then
|
|
echo -e "\nYou did not supply enough arguments. \nUsage: $0 <host> <username> <password> <version> \n \n$0 checks Microsoft SQL Server connectivity. It works with versions 7 and 2000.\n\nYou need a working version of FreeTDS (http://www.freetds.org/) and tsql (included in FreeTDS 6.0+) to connect to the SQL server. \nIt was written by Tom De Blende (tom.deblende@village.uunet.be) in 2003. \n\nExample:\n $0 dbserver sa f00bar 2000\n" && exit "3"
|
|
|
|
-elif [ $tsqlcmd == "" ]; then
|
|
+elif [ $tsqlcmd = "" ]; then
|
|
echo -e "tsql not found! Please verify you have a working version of tsql (included in the FreeTDS version 6.0+) and enter the full path in the script." && exit "3"
|
|
|
|
fi
|
|
@@ -50,9 +50,9 @@ exit="3"
|
|
|
|
tmpfile=`$mktempcmd /tmp/$hostname.XXXXXX`
|
|
|
|
-if [ $srv == "7" ]; then
|
|
+if [ $srv = "7" ]; then
|
|
spid=7
|
|
-elif [ $srv == "2000" ]; then
|
|
+elif [ $srv = "2000" ]; then
|
|
spid=50
|
|
else
|
|
echo -e "$srv is not a supported MS SQL Server version!" && exit "3"
|
|
@@ -69,7 +69,7 @@ $tsqlcmd -S $hostname -U $usr -P $pswd <
|
|
|
|
$grepcmd -q "Login failed for user" $errorfile
|
|
|
|
-if [ "$?" == "0" ]; then
|
|
+if [ "$?" = "0" ]; then
|
|
$rmcmd -f $tmpfile $resultfile $errorfile;
|
|
echo CRITICAL - Could not make connection to SQL server. Login failed.;
|
|
exit 2;
|
|
@@ -77,7 +77,7 @@ fi
|
|
|
|
$grepcmd -q "There was a problem connecting to the server" $errorfile
|
|
|
|
-if [ "$?" == "0" ]; then
|
|
+if [ "$?" = "0" ]; then
|
|
$rmcmd -f $tmpfile $resultfile $errorfile;
|
|
echo CRITICAL - Could not make connection to SQL server. Incorrect server name or SQL service not running.;
|
|
exit 2;
|
|
@@ -85,7 +85,7 @@ fi
|
|
|
|
resultfileln=`$catcmd $resultfile | $wccmd -l | $sedcmd 's/ //g'`
|
|
|
|
-if [ "$resultfileln" == "2" ]; then
|
|
+if [ "$resultfileln" = "2" ]; then
|
|
$rmcmd -f $tmpfile $resultfile $errorfile;
|
|
echo CRITICAL - Could not make connection to SQL server. No data received from host.;
|
|
exit 2;
|