<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19154"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>Hi there --</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>I made some progress on my end. To start off, I confirmed the
firewall is disabled on the SQL server. I then investigated the possibility that
a named instance was being used</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>on the server. It turns out that is the case. I then went to
the SQL Server Configuration Manager utility/Network Configuration, and made
note of the TCP Dynamic Ports value. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>Using that information, </FONT></SPAN><SPAN
class=910444222-17112011><FONT color=#0000ff size=2 face=Arial>I entered the
following command syntax:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>check_mssql -H <ip address> --username sa
--password <password> --port <dynamic port></FONT></SPAN></DIV>
<DIV><SPAN class=910444222-17112011><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=910444222-17112011><FONT color=#0000ff size=2 face=Arial>The
result was the following:</FONT></DIV>
<DIV dir=ltr align=left><BR><FONT color=#0000ff size=2 face=Arial>OK: Connect
time=0.006639 seconds.</FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial></FONT> </DIV>
<DIV dir=ltr align=left></SPAN><SPAN class=910444222-17112011><FONT
color=#0000ff size=2 face=Arial>I then tried to run the check_mssql_health
plugin using the syntaxes shown below:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>./check_mssql_health --hostname=<ip
address> --username=sa --password=<password> --port=<dynamic
port> --mode=connection-time</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>./check_mssql_health --hostname <ip
address> --username sa --password <password> --port <dynamic
port> --mode connection-time</FONT></SPAN></DIV></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>The error message that I encountered in both cases was the
following:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>CRITICAL - cannot connect to <ip address>. DBI
connect(';host=<ip address>;port=62502','sa',...) failed: (no error
string) at /usr/local/nagios/libexec/check_mssql_health line
2175</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>If I can get the latter plugin to work, that will enable more
extensive checking of the server. What could be the problem
here?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial>Thanks. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=910444222-17112011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Claudio Kuenzler
[mailto:ck@claudiokuenzler.com] <BR><B>Sent:</B> Thursday, November 17, 2011
3:33 PM<BR><B>To:</B> Kaplan, Andrew H.<BR><B>Cc:</B> Nagios Users
List<BR><B>Subject:</B> Re: [Nagios-users] Monitoring a Microsoft SQL
Server<BR></FONT><BR></DIV>
<DIV></DIV>The other ports don't appear like typical MSSQL ports.<BR>Do you have
by any chance the Windows firewall still active? Maybe the port is being blocked
there?<BR><A
href="http://support.microsoft.com/kb/968872">http://support.microsoft.com/kb/968872</A><BR><BR>Or
do you use a named instance? I found this information on <A
href="http://benchmarkitconsulting.com/colin-stasiuk/2009/02/02/what-tcp-port-is-sql-server-running-under/">http://benchmarkitconsulting.com/colin-stasiuk/2009/02/02/what-tcp-port-is-sql-server-running-under/</A>:
"If you have a named instance the TCP port is dynamically configured."<BR>I've
never seen this in a practical way before though.<BR><BR><BR>
<DIV class=gmail_quote>On Thu, Nov 17, 2011 at 8:59 PM, Kaplan, Andrew H. <SPAN
dir=ltr><<A
href="mailto:AHKAPLAN@partners.org">AHKAPLAN@partners.org</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><U></U>
<DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN>Hi there
--</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN>I tried
connecting to port 1433 of the SQL server, and the connection was refused. It
appears that efforts to connect via the default</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN>port will
not work in this case. I took the liberty of running the nestat -abn command
syntax on the console of the SQL server, and</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN>searched
for all references to the sqlservr.exe binary. The results are shown
below:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial><SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><SPAN><SPAN lang=EN>
<P><FONT color=#0000ff size=2 face=Arial>Active Connections</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A href="http://0.0.0.0:58477"
target=_blank>0.0.0.0:58477</A> <A href="http://0.0.0.0:0"
target=_blank>0.0.0.0:0</A> LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A href="http://0.0.0.0:62502"
target=_blank>0.0.0.0:62502</A> <A href="http://0.0.0.0:0"
target=_blank>0.0.0.0:0</A> LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A href="http://0.0.0.0:65249"
target=_blank>0.0.0.0:65249</A> <A href="http://0.0.0.0:0"
target=_blank>0.0.0.0:0</A> LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A href="http://127.0.0.1:58751"
target=_blank>127.0.0.1:58751</A> <A href="http://0.0.0.0:0"
target=_blank>0.0.0.0:0</A> LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A href="http://127.0.0.1:62503"
target=_blank>127.0.0.1:62503</A> <A href="http://0.0.0.0:0"
target=_blank>0.0.0.0:0</A> LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A href="http://127.0.0.1:63954"
target=_blank>127.0.0.1:63954</A> <A href="http://127.0.0.1:63955"
target=_blank>127.0.0.1:63955</A> ESTABLISHED</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A
href="http://192.168.40.114:62502" target=_blank>192.168.40.114:62502</A> <A
href="http://192.168.40.122:50342" target=_blank>192.168.40.122:50342</A>
ESTABLISHED</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A
href="http://192.168.40.114:62502" target=_blank>192.168.40.114:62502</A> <A
href="http://192.168.40.125:60257" target=_blank>192.168.40.125:60257</A>
ESTABLISHED</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP <A
href="http://192.168.125.1:139" target=_blank>192.168.125.1:139</A> <A
href="http://0.0.0.0:0" target=_blank>0.0.0.0:0</A> LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP [::]:58477 [::]:0
LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP [::]:62502 [::]:0
LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP [::]:65249 [::]:0
LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP [::1]:58751 [::]:0
LISTENING</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>TCP [::1]:62005 [::1]:62006
ESTABLISHED</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>[sqlservr.exe]</FONT></P>
<P><FONT color=#0000ff size=2 face=Arial>UDP <A href="http://0.0.0.0:123"
target=_blank>0.0.0.0:123</A> *:* </FONT></P>
<P><FONT color=#0000ff size=2 face=Arial></FONT> </P>
<P><SPAN><FONT color=#0000ff size=2 face=Arial>If the default port, 1433, is
not reachable would one the above ports be the alternate means of connecting
to the server?</FONT></SPAN></P>
<P><SPAN></SPAN> </P>
<P><FONT color=#0000ff size=2 face=Arial></FONT> </P>
<P><FONT color=#0000ff size=2 face=Arial></FONT></P></SPAN></SPAN></DIV><FONT
color=#0000ff size=2 face=Arial></FONT><BR>
<DIV dir=ltr lang=en-us align=left>
<HR>
<FONT size=2 face=Tahoma><B>From:</B> Claudio Kuenzler [mailto:<A
href="mailto:ck@claudiokuenzler.com" target=_blank>ck@claudiokuenzler.com</A>]
<BR><B>Sent:</B> Thursday, November 17, 2011 1:39 PM
<DIV class=im><BR><B>To:</B> Nagios Users List<BR><B>Subject:</B> Re:
[Nagios-users] Monitoring a Microsoft SQL Server<BR></DIV></FONT><BR></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV></DIV>Please let us know if you get it working - I might have to add such
a check soon as well.<BR><BR>To answer your question: 1433 is the standard
port of MSSQL so that should be ok. You can launch nmap or a simple telnet to
double-check that.<BR><BR>
<DIV class=gmail_quote>On Thu, Nov 17, 2011 at 4:34 PM, Jim Avery <SPAN
dir=ltr><<A href="mailto:jim@jimavery.me.uk"
target=_blank>jim@jimavery.me.uk</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV>On 17 November 2011 15:17, Kaplan, Andrew H. <<A
href="mailto:AHKAPLAN@partners.org"
target=_blank>AHKAPLAN@partners.org</A>> wrote:<BR>> Hi there
--<BR>><BR>> Thanks for your reply. I tried your suggestion on the two
plugins, and here are<BR>> the results.<BR>><BR>> When the command
syntax for check_mssql was the following:<BR>><BR>> ./check_mssql -H
<ip address> -U <domain>\\<username> -P
<password><BR>><BR>> or<BR>><BR>> ./check_mssql -H <ip
address> -U '<domain>\\<username>' -P
<password><BR>><BR>> The error message displayed on-screen
was:<BR>><BR>> UNKNOWN: Invalid characters in the
username.<BR><BR><BR></DIV>The check_mssql plugin is way too fussy about
what characters it will<BR>allow in host names and user names. On my
system I edited the plugin<BR>to remove the if/else sections entirely below
the comments "//<BR>Validate the hostname" and "// Validate the
username".<BR><BR>hth,<BR><FONT color=#888888><BR>Jim<BR></FONT>
<DIV>
<DIV></DIV>
<DIV><BR>------------------------------------------------------------------------------<BR>All
the data continuously generated in your IT infrastructure<BR>contains a
definitive record of customers, application performance,<BR>security
threats, fraudulent activity, and more. Splunk takes this<BR>data and makes
sense of it. IT sense. And common sense.<BR><A
href="http://p.sf.net/sfu/splunk-novd2d"
target=_blank>http://p.sf.net/sfu/splunk-novd2d</A><BR>_______________________________________________<BR>Nagios-users
mailing list<BR><A href="mailto:Nagios-users@lists.sourceforge.net"
target=_blank>Nagios-users@lists.sourceforge.net</A><BR><A
href="https://lists.sourceforge.net/lists/listinfo/nagios-users"
target=_blank>https://lists.sourceforge.net/lists/listinfo/nagios-users</A><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></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV><FONT
face=monospace><BR>
<DIV class=im><BR>The information in this e-mail is intended only for the
person to whom it is<BR>addressed. If you believe this e-mail was sent to you
in error and the e-mail<BR>contains patient information, please contact the
Partners Compliance HelpLine at<BR><A
href="http://www.partners.org/complianceline"
target=_blank>http://www.partners.org/complianceline</A> . If the e-mail was
sent to you in error<BR>but does not contain patient information, please
contact the sender and properly<BR>dispose of the
e-mail.</DIV></FONT></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>