<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Wow, so little time to follow the list, but I've got through all this so I figure I had to chime in... <BR>
 <BR>
Start testing via the command line...<BR>
my environment works like...  <BR>
[root@server]# ./check_mssql -H mssqlsrvr -p 1433 -t 10 -U user -P password<BR>
CHECK_MSSQL OK - SQL Server responded in 0.025192 seconds | time=0.025192s;;<BR>
 <BR>
NOTES<BR>
1) based on your freetds entry... the servername for the check should be "MSSQL"<BR>
2) are you using windows or SQL Auth?  if using windows domain users to auth... you may need to do "-U domain\\user" as the username<BR>
 <BR>
Also tweak the debug logging and check the logs for other helpful bits.<BR>
<BR><BR>-- <BR>Mat W. - <A href="http://www.techadre.com/">http://www.techadre.com</A><BR><BR><BR> <BR>> Date: Thu, 10 Sep 2009 17:21:50 +0100<BR>> From: jim@jimavery.me.uk<BR>> To: nagios-users@lists.sourceforge.net<BR>> Subject: Re: [Nagios-users] CHECK_MSSQL CRITICAL allways as output when use check_sql for MSSQL checking<BR>> <BR>> 2009/9/9 Arlen Drina <arlytex@gmail.com>:<BR>> > Hi all,<BR>> ><BR>> > I am using check_sql for checking MSSQL server ( or I would like to<BR>> > check MSSQL servers ). I compiled<BR>> > freetds with --with-tdsver=8.0 support on my debian system and all<BR>> > went ok, in /etc/freetds.conf I have<BR>> ><BR>> > [global]<BR>> >        # TDS protocol version<BR>> > #;      tds version = 4.2<BR>> >        tds version = 8.0<BR>> ><BR>> > # A typical Microsoft server<BR>> > [MSSQL]<BR>> >        host = sss.sss.sss.sss<BR>> >        port = 1433<BR>> >        tds version = 8.0<BR>> ><BR>> > and when I run ./check_mssql -H sss.sss.sss.sss -p 1433 -U USER -P PASSWORD<BR>> ><BR>> > I am constantly getting output<BR>> ><BR>> > CHECK_MSSQL CRITICAL<BR>> ><BR>> > Ok, I tried to solve this myself and I found at \<BR>> ><BR>> > http://exchange.nagios.org/directory/Plugins/Databases/Others/check_sql/details<BR>> > that is recommneded to change host-->server in line<BR>> ><BR>> > my $cs = "DBI:$driver:" . ($database ? "database=$database;" : '') .<BR>> > "server=$hostname" . ($port ? ";port=$port" : '');<BR>> ><BR>> > so I changed that, but still I am getting same output for above command.<BR>> ><BR>> > I am just trying to get minimal response from MSSQL server, connection<BR>> > to port 1433 is open and I can connect via<BR>> > telnet sss.sss.sss.sss 1433  and it works.<BR>> ><BR>> > Any hint is welcome, I exhausted all my ideas, and thank you in advance<BR>> <BR>> <BR>> I don't use freetds. Instead, I installed php5-sybase (and any<BR>> dependencies if there were any, I can't remember) from the debian<BR>> repositories (I'm using Ubuntu).<BR>> <BR>> I can run the plugin from the command line like so:<BR>> <BR>> /usr/local/nagios/libexec/check_mssql -H 10.10.10.123 -U loginid -P mypassword<BR>> OK: Connect time=0.004189 seconds.<BR>> <BR>> Of course, the user "loginid" must be configured in MSSQL with the<BR>> password "mypassword" to authenticate to the database.<BR>> <BR>> Some of our MSSQL servers have a specific instance, in which case you<BR>> need to find the port number the instance is listening on, then use<BR>> the following syntax to do the check:<BR>> <BR>> /usr/local/nagios/libexec/check_mssql -H 10.10.10.123:1375 -u<BR>> loginid -P mypassword<BR>> OK: Connect time=0.045179 seconds.<BR>> <BR>> (1375 is the port number for this instance but it varies from one to the next)<BR>> <BR>> I found the check_mssql didn't like the hostname syntax when using IP<BR>> addresses like this, so I changed it a bit by removing both the<BR>> "Validate the hostname" and "Validate the username" sections.<BR>> <BR>> I also (very sloppily) altered the part where it checks if the<BR>> expected result is emtpy like so:<BR>> <BR>> 287c205<BR>> < if ($querytype == "query" && !empty($expected_result)) {<BR>> ---<BR>> > if ($querytype == "query" && (!empty($expected_result) ||<BR>> $expected_result == "0")) {<BR>> <BR>> That was because I wanted to do a check which expected a result "0".<BR>> <BR>> <BR>> hth,<BR>> <BR>> Jim<BR>> <BR>> ------------------------------------------------------------------------------<BR>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day <BR>> trial. Simplify your report design, integration and deployment - and focus on <BR>> what you do best, core application coding. Discover what's new with <BR>> Crystal Reports now. http://p.sf.net/sfu/bobj-july<BR>> _______________________________________________<BR>> Nagios-users mailing list<BR>> Nagios-users@lists.sourceforge.net<BR>> https://lists.sourceforge.net/lists/listinfo/nagios-users<BR>> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. <BR>> ::: Messages without supporting info will risk being sent to /dev/null<BR><br /><hr />With Windows Live, you can organize, edit, and share your photos. <a href='http://www.windowslive.com/Desktop/PhotoGallery' target='_new'>Click here.</a></body>
</html>