Monitor MSSQLSERVER service

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
sixstringssteve
Posts: 21
Joined: Thu Sep 17, 2015 4:28 pm

Monitor MSSQLSERVER service

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitor MSSQLSERVER service

Post 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).
Be sure to check out our Knowledgebase for helpful articles and solutions!
sixstringssteve
Posts: 21
Joined: Thu Sep 17, 2015 4:28 pm

Re: Monitor MSSQLSERVER service

Post by sixstringssteve »

I have checked that. There is no $, just MSSQLSERVER
sixstringssteve
Posts: 21
Joined: Thu Sep 17, 2015 4:28 pm

Re: Monitor MSSQLSERVER service

Post by sixstringssteve »

I even tried the display name but it has ( ) in it so it throws a Syntax error....still nothing
Attachments
Snip of the service name
Snip of the service name
sql.JPG (19.92 KiB) Viewed 7891 times
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitor MSSQLSERVER service

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitor MSSQLSERVER service

Post 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
Former Nagios Employee.
me.
sixstringssteve
Posts: 21
Joined: Thu Sep 17, 2015 4:28 pm

Re: Monitor MSSQLSERVER service

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitor MSSQLSERVER service

Post by hsmith »

Can you try PROCSTATE instead of SERVICESTATE?
Former Nagios Employee.
me.
sixstringssteve
Posts: 21
Joined: Thu Sep 17, 2015 4:28 pm

Re: Monitor MSSQLSERVER service

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitor MSSQLSERVER service

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked