Page 1 of 2

SQL Database monitoring

Posted: Thu Jun 18, 2015 7:52 am
by adminfun
Dear members and admins

I'm having some trouble with the monitoring of an SQL Database.
Unfortunately I'm not a wizard in Nagios and SQL so that's why I've come here for help.
I've added some screenshots in attachement.
Thank you in advance!

Re: SQL Database monitoring

Posted: Thu Jun 18, 2015 9:12 am
by tmcdonald
adminfun wrote:I'm having some trouble with the monitoring of an SQL Database.
What trouble are you having?

Re: SQL Database monitoring

Posted: Fri Jun 19, 2015 8:48 am
by adminfun
I get the following error: <class 'pymssql.InterfaceError'>
So I'm wondering, is there something wrong with the setup on the Nagios side or is there a problem with security on the SQL server.

Re: SQL Database monitoring

Posted: Fri Jun 19, 2015 10:00 am
by tgriep
Couple of things to try is to specify the port in your command, use 1433 for the port number.
On your SQL server, you may need to change it to mix mode authentication.

Re: SQL Database monitoring

Posted: Wed Jun 24, 2015 6:57 am
by adminfun
If I add port 1433 I get the error Cannot specify port and instance.

Re: SQL Database monitoring

Posted: Wed Jun 24, 2015 7:59 am
by adminfun
Here some screenshots.

Re: SQL Database monitoring

Posted: Wed Jun 24, 2015 9:08 am
by lmiltchev
You can use either an instance name or a port number but not both...

Try testing it from the CLI first. For example, with the instance name, you can try something like this:

Code: Select all

/usr/local/nagios/libexec/check_mssql_database.py -H 10.20.1.110 -U '<username> -P '<password>' -T 'master' -I VIM_SQLEXP --time2connect --warning 1 --critical 5

Re: SQL Database monitoring

Posted: Wed Jun 24, 2015 9:20 am
by adminfun
Ok guys I got it working on a different server which uses the default port 1433.
The server I want to monitor however is using dynamic ports 49294.
When I leave the instance blank and fill in the port number (49294) I get the error SQL Server message 18456, severity 14, state 1, line 1: provided in the screenshot.
If I leave the port blank and fill in the instance name I get the error <class 'pymssql.InterfaceError'>.

Re: SQL Database monitoring

Posted: Wed Jun 24, 2015 9:51 am
by lmiltchev
Can you show us an example of the check run from the CLI? Hide sensitive info.

Are you using 'username' or 'domain/username' or 'domain\username'? Are you using a Windows account or MSSQL local account? A similar error is described here:

http://stackoverflow.com/questions/1695 ... -server-py

Re: SQL Database monitoring

Posted: Thu Jun 25, 2015 2:53 am
by adminfun
I'm using an MSSQL local account. This server however is not using the standard 1433 port but dynamics ports.
I provided some screenshots in attachement.