SQL Database monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
adminfun
Posts: 28
Joined: Mon May 11, 2015 9:06 am
Location: Bruges

SQL Database monitoring

Post 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!
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: SQL Database monitoring

Post by tmcdonald »

adminfun wrote:I'm having some trouble with the monitoring of an SQL Database.
What trouble are you having?
Former Nagios employee
adminfun
Posts: 28
Joined: Mon May 11, 2015 9:06 am
Location: Bruges

Re: SQL Database monitoring

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SQL Database monitoring

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
adminfun
Posts: 28
Joined: Mon May 11, 2015 9:06 am
Location: Bruges

Re: SQL Database monitoring

Post by adminfun »

If I add port 1433 I get the error Cannot specify port and instance.
adminfun
Posts: 28
Joined: Mon May 11, 2015 9:06 am
Location: Bruges

Re: SQL Database monitoring

Post by adminfun »

Here some screenshots.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: SQL Database monitoring

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
adminfun
Posts: 28
Joined: Mon May 11, 2015 9:06 am
Location: Bruges

Re: SQL Database monitoring

Post 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'>.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: SQL Database monitoring

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
adminfun
Posts: 28
Joined: Mon May 11, 2015 9:06 am
Location: Bruges

Re: SQL Database monitoring

Post 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.
You do not have the required permissions to view the files attached to this post.
Locked