monitor sqlserver database

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

monitor sqlserver database

Post by hanya.radwan »

I created services to connect to sqlserver DB, but all the services return the following:
[root@nms ~]# /usr/local/nagios/libexec/check_mssql_database.py -H 10.102.6.150 -U 'sa' -P 'jwl_f!eet4Altair' -T 'GPS' -I fleet-dbsrv --datasize --warning 17000000 --critical 20000000
<class 'pymssql.InterfaceError'>
Caught unexpected error. This could be caused by your sysperfinfo not containing the proper entries for this query, and you may delete this service check.
belvdr
Posts: 81
Joined: Tue Oct 08, 2013 9:17 pm

Re: monitor sqlserver database

Post by belvdr »

Do you have the prerequisites installed per:

http://exchange.nagios.org/directory/Pl ... ts/details
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: monitor sqlserver database

Post by hanya.radwan »

I didn't install that on remote server, but this required for linux, what about windows since I used windows.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: monitor sqlserver database

Post by tmcdonald »

That's not something you install on the remote server. You need the proper python packages on your Nagios server. Try this:

Code: Select all

yum install pymssql -y
Former Nagios employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: monitor sqlserver database

Post by lmiltchev »

Double check to make sure you are using the correct IP address, and correct credentials. Can you run the following command and show the output?

Code: Select all

/usr/local/nagios/libexec/check_mssql_database.py -H 10.102.6.150 -U 'sa' -P 'jwl_f!eet4Altair' -T 'GPS' -I fleet-dbsrv
Did you get an output, similar to this one?

Code: Select all

OK: Time to connect was 0.00788998603821s|time=0.00788998603821s;;;;;
Be sure to check out our Knowledgebase for helpful articles and solutions!
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: monitor sqlserver database

Post by hanya.radwan »

I installed yum install pymssql -y.

[root@nms ~]# /usr/local/nagios/libexec/check_mssql_database.py -H 10.102.6.150 -U 'sa' -P 'jwl_f!eet4Altair' -T 'GPS' -I fleet-dbsrv
<class 'pymssql.InterfaceError'>
Caught unexpected error. This could be caused by your sysperfinfo not containing the proper entries for this query, and you may delete this service check.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: monitor sqlserver database

Post by lmiltchev »

Can you run the following command and show us the output?

Code: Select all

nmap 10.102.6.150 -p 1433
Be sure to check out our Knowledgebase for helpful articles and solutions!
hanya.radwan
Posts: 194
Joined: Tue Feb 25, 2014 6:12 am
Location: palestine

Re: monitor sqlserver database

Post by hanya.radwan »

[root@nms ~]# nmap 10.102.6.150 -p 1433

Starting Nmap 5.51 ( http://nmap.org ) at 2014-07-13 11:48 EEST
Nmap scan report for 10.102.6.150
Host is up (0.0012s latency).
PORT STATE SERVICE
1433/tcp filtered ms-sql-s

Nmap done: 1 IP address (1 host up) scanned in 0.66 seconds
You have new mail in /var/spool/mail/root
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: monitor sqlserver database

Post by slansing »

It looks like the default port is filtered, you will need to unblock it in order to get proper traffic through. This may or may not be the root cause of this issue, but you will need to unblock it regardless. Let us know how the command's output looks after you unblock that port. If it is still the same, post the output of:

Code: Select all

nmap 10.102.6.150 -p 1433
belvdr
Posts: 81
Joined: Tue Oct 08, 2013 9:17 pm

Re: monitor sqlserver database

Post by belvdr »

slansing wrote:It looks like the default port is filtered, you will need to unblock it in order to get proper traffic through. This may or may not be the root cause of this issue, but you will need to unblock it regardless. Let us know how the command's output looks after you unblock that port. If it is still the same, post the output of:

Code: Select all

nmap 10.102.6.150 -p 1433
If it's a named instance, it will not use 1433 by default.

It appears the plugin accepts the -I <instance name> parameter, so if you have a named instance, use that instead.
Locked