Monitoring a Microsoft SQL Server

Kaplan, Andrew H. AHKAPLAN at PARTNERS.ORG
Thu Nov 17 23:54:35 CET 2011


Hi there --
 
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
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. 
Using that information, I entered the following command syntax:
 
check_mssql -H <ip address> --username sa --password <password> --port <dynamic
port>
 
The result was the following:

OK: Connect time=0.006639 seconds.
 
I then tried to run the check_mssql_health plugin using the syntaxes shown
below:
 
./check_mssql_health --hostname=<ip address> --username=sa --password=<password>
--port=<dynamic port> --mode=connection-time
./check_mssql_health --hostname <ip address> --username sa --password <password>
--port <dynamic port> --mode connection-time
 
The error message that I encountered in both cases was the following:
 
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
 
If I can get the latter plugin to work, that will enable more extensive checking
of the server. What could be the problem here?
 
Thanks. 
 
 

________________________________

From: Claudio Kuenzler [mailto:ck at claudiokuenzler.com] 
Sent: Thursday, November 17, 2011 3:33 PM
To: Kaplan, Andrew H.
Cc: Nagios Users List
Subject: Re: [Nagios-users] Monitoring a Microsoft SQL Server


The other ports don't appear like typical MSSQL ports.
Do you have by any chance the Windows firewall still active? Maybe the port is
being blocked there?
http://support.microsoft.com/kb/968872

Or do you use a named instance? I found this information on
http://benchmarkitconsulting.com/colin-stasiuk/2009/02/02/what-tcp-port-is-sql-s
erver-running-under/: "If you have a named instance the TCP port is dynamically
configured."
I've never seen this in a practical way before though.



On Thu, Nov 17, 2011 at 8:59 PM, Kaplan, Andrew H. <AHKAPLAN at partners.org>
wrote:


	
	Hi there --
	 
	I tried connecting to port 1433 of the SQL server, and the connection
was refused. It appears that efforts to connect via the default
	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
	searched for all references to the sqlservr.exe binary. The results are
shown below:
	 
	Active Connections

	[sqlservr.exe]

	TCP 0.0.0.0:58477 0.0.0.0:0 LISTENING

	[sqlservr.exe]

	TCP 0.0.0.0:62502 0.0.0.0:0 LISTENING

	[sqlservr.exe]

	TCP 0.0.0.0:65249 0.0.0.0:0 LISTENING

	[sqlservr.exe]

	TCP 127.0.0.1:58751 0.0.0.0:0 LISTENING

	[sqlservr.exe]

	TCP 127.0.0.1:62503 0.0.0.0:0 LISTENING

	[sqlservr.exe]

	TCP 127.0.0.1:63954 127.0.0.1:63955 ESTABLISHED

	[sqlservr.exe]

	TCP 192.168.40.114:62502 192.168.40.122:50342 ESTABLISHED

	[sqlservr.exe]

	TCP 192.168.40.114:62502 192.168.40.125:60257 ESTABLISHED

	[sqlservr.exe]

	TCP 192.168.125.1:139 0.0.0.0:0 LISTENING

	[sqlservr.exe]

	TCP [::]:58477 [::]:0 LISTENING

	[sqlservr.exe]

	TCP [::]:62502 [::]:0 LISTENING

	[sqlservr.exe]

	TCP [::]:65249 [::]:0 LISTENING

	[sqlservr.exe]

	TCP [::1]:58751 [::]:0 LISTENING

	[sqlservr.exe]

	TCP [::1]:62005 [::1]:62006 ESTABLISHED

	[sqlservr.exe]

	UDP 0.0.0.0:123 *:* 

	 

	If the default port, 1433, is not reachable would one the above ports be
the alternate means of connecting to the server?

	 

	 

	

	
	
________________________________

	From: Claudio Kuenzler [mailto:ck at claudiokuenzler.com] 
	Sent: Thursday, November 17, 2011 1:39 PM 

	To: Nagios Users List
	Subject: Re: [Nagios-users] Monitoring a Microsoft SQL Server
	

	Please let us know if you get it working - I might have to add such a
check soon as well.
	
	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.
	
	
	On Thu, Nov 17, 2011 at 4:34 PM, Jim Avery <jim at jimavery.me.uk> wrote:
	

		On 17 November 2011 15:17, Kaplan, Andrew H.
<AHKAPLAN at partners.org> wrote:
		> Hi there --
		>
		> Thanks for your reply. I tried your suggestion on the two
plugins, and here are
		> the results.
		>
		> When the command syntax for check_mssql was the following:
		>
		> ./check_mssql -H <ip address> -U <domain>\\<username> -P
<password>
		>
		> or
		>
		> ./check_mssql -H <ip address> -U '<domain>\\<username>' -P
<password>
		>
		> The error message displayed on-screen was:
		>
		> UNKNOWN: Invalid characters in the username.
		
		
		
		The check_mssql plugin is way too fussy about what characters it
will
		allow in host names and user names.  On my system I edited the
plugin
		to remove the if/else sections entirely below the comments "//
		Validate the hostname" and "// Validate the username".
		
		hth,
		
		Jim
		

	
------------------------------------------------------------------------------
		All the data continuously generated in your IT infrastructure
		contains a definitive record of customers, application
performance,
		security threats, fraudulent activity, and more. Splunk takes
this
		data and makes sense of it. IT sense. And common sense.
		http://p.sf.net/sfu/splunk-novd2d
		_______________________________________________
		Nagios-users mailing list
		Nagios-users at lists.sourceforge.net
		https://lists.sourceforge.net/lists/listinfo/nagios-users
		::: Please include Nagios version, plugin version (-v) and OS
when reporting any issue.
		::: Messages without supporting info will risk being sent to
/dev/null
		


	
	

	The information in this e-mail is intended only for the person to whom
it is
	addressed. If you believe this e-mail was sent to you in error and the
e-mail
	contains patient information, please contact the Partners Compliance
HelpLine at
	http://www.partners.org/complianceline . If the e-mail was sent to you
in error
	but does not contain patient information, please contact the sender and
properly
	dispose of the e-mail.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20111117/fd25a974/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list