Page 1 of 3

Monitor MSSQLSERVER service

Posted: Wed Sep 23, 2015 10:23 am
by sixstringssteve
We have a Nagios4 Core deployment and it seems to be working very well with only a couple hiccups. We are having an issue with monitoring the MSSQLSERVER service on our SQL server. I am monitoring several Windows services, all successfully but this one. The console claims that MSSQLSERVER cannot be found.

Here is the service entry in the config file.....

[define service{
use generic-service
host_name <SQL Server Host Name>
service_description Microsoft SQL Server
check_command check_nt!SERVICESTATE!-d SHOWALL -l MSSQLSERVER
}


We are just, at this point, trying to monitor that the SQL database engine is running.

Any ideas on why this one service would not want to register as running?

Re: Monitor MSSQLSERVER service

Posted: Wed Sep 23, 2015 12:06 pm
by lmiltchev
Check to see what is the exact "Service name" and "Display name" of your service (as listed under "Services"). Is it "MSSQLSERVER"? Is there a "$" (dollar sign) in the name? At least one of them should work (service name or display name).

Re: Monitor MSSQLSERVER service

Posted: Wed Sep 23, 2015 1:04 pm
by sixstringssteve
I have checked that. There is no $, just MSSQLSERVER

Re: Monitor MSSQLSERVER service

Posted: Wed Sep 23, 2015 1:10 pm
by sixstringssteve
I even tried the display name but it has ( ) in it so it throws a Syntax error....still nothing

Re: Monitor MSSQLSERVER service

Posted: Wed Sep 23, 2015 4:28 pm
by lmiltchev
Interesting, I am not able to recreate the issue. In fact, both commands work just fine for me:

Code: Select all

[root@testbox ~]# /usr/local/nagios/libexec/check_nt -H x.x.x.x -s password -p 12489 -v SERVICESTATE -d SHOWALL -l MSSQLSERVER
 MSSQLSERVER: Started
[root@testbox ~]# /usr/local/nagios/libexec/check_nt -H x.x.x.x -s password -p 12489 -v SERVICESTATE -d SHOWALL -l "SQL SERVER (MSSQLSERVER)"
 SQL SERVER (MSSQLSERVER): Started
What is the version of NSCLient++ that you are currently using?

Code: Select all

./check_nt -H x.x.x.x -s password -p 12489 -v CLIENTVERSION

Re: Monitor MSSQLSERVER service

Posted: Wed Sep 23, 2015 4:31 pm
by hsmith
In addition to what lmitchev said, try wrapping the display name in quotes. I found an instance of where this happened if there are multiple service names..may not be the issue, and was using a different plugin but this may be all right for reference...

https://support.nagios.com/forum/viewto ... 54&p=57666

Re: Monitor MSSQLSERVER service

Posted: Fri Sep 25, 2015 7:58 am
by sixstringssteve
root@nagios:/etc/nagiosql/hosts# /usr/local/nagios/libexec/check_nt -H x.x.x.x -p 12489 -v SERVICESTATE -d SHOWALL -l MSSQLSERVER
MSSQLSERVER: Not found
root@nagios:/etc/nagiosql/hosts# /usr/local/nagios/libexec/check_nt -H x.x.x.x -p 12489 -v SERVICESTATE -d SHOWALL -l "SQL SERVER (MSSQLSERVER)"
SQL SERVER (MSSQLSERVER): Not found
root@nagios:/etc/nagiosql/hosts# /usr/local/nagios/libexec/check_nt -H x.x.x.x -p 12489 -v CLIENTVERSION
NSClient++ 0,4,1,73 2012-12-17


I don't get it, I have used Nagios to monitor MS SQL before and had no issues.

Re: Monitor MSSQLSERVER service

Posted: Fri Sep 25, 2015 9:37 am
by hsmith
Can you try PROCSTATE instead of SERVICESTATE?

Re: Monitor MSSQLSERVER service

Posted: Fri Sep 25, 2015 3:23 pm
by sixstringssteve
Still a NOGO... :?:

root@nagios:/etc/nagiosql/hosts# /usr/local/nagios/libexec/check_nt -H x.x.x.x -p 12489 -v PROCSTATE -d SHOWALL -l MSSQLSERVER
MSSQLSERVER: not running

Re: Monitor MSSQLSERVER service

Posted: Mon Sep 28, 2015 9:35 am
by lmiltchev
Can you run the following commands and show us the output?

on the Windows server:

Code: Select all

tasklist | find "sqlservr.exe"
on the nagios box:

Code: Select all

/etc/nagiosql/hosts# /usr/local/nagios/libexec/check_nt -H x.x.x.x -s 'password' -p 12489 -v PROCSTATE -d SHOWALL -l "sqlservr.exe"
Does the output change if you restart the service?

Note: the checks works for me just fine but I am using NSClient++ 0,4,1,90 2013-02-04. I am not sure if this makes a difference. You can try upgrading the NSClient++ agent and/or posting your question on the NSClient++ support forum. The developer of the agent may be able to help you resolve this issue faster. NSClient++ is not developed or maintained by us.