Genral Help with MSSQL

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
UnifraxLtd
Posts: 7
Joined: Tue Feb 28, 2012 10:19 am

Genral Help with MSSQL

Post by UnifraxLtd »

Ok, I know nothing about linux, centos etc so my knowledge is less than basic. I downloaded the Nagios XI VM and I have this running.

I've managed to get it looking at switches, firewalls (Basically) I have had all kinds of problems with the NSClient++, However I've been trying to monitor my MS SQL servers I have about 6 of them. I run through the monitoring wizard pick MS SQL Server, fill out the wizards fields, name, instance, port, username, password. Nothing it only ever goes to critical and states a null result. I've been doing this for over a week and still have nothing to show for it.

There are no firewalls I've turned them off, some SQL Servers are in one domain, some in another, some are on standalone servers. I have used every combination of users names and password and nothing same result every time, its so frustrating, GFI, Solarwindws, Foglight, MS I have got all these systems to work but not nagios and nagios is the front end I like, it does plenty except I can't get it to work. Do I use windows accounts/sql accounts what, I've tried all of them.

I found another thread where the guy had the same problem but he seemed to solve it, I have done what he did (I think) but still no solution. http://support.nagios.com/forum/viewtop ... f=6&t=4508

Can anyone please help me.
UnifraxLtd
Posts: 7
Joined: Tue Feb 28, 2012 10:19 am

Re: Genral Help with MSSQL

Post by UnifraxLtd »

OK following on from this I've worked out where to go on the command line to test so I did the following:

cd /usr/local/nagios/libexec
./check_mssql_database.py -H myserver.domain.local -U nagiosusername -P password -T MyDatabaseName --activetrans --warning 10 --critical 20

I get the result now Pymssql is required for operation. Please install it.

I've looked into this and I require pymssql, i tried to install this and it said I needed Cython, then it stated I needed a development version of python before cython would install. Happy days.

I did the following:

Install Developer Python
====================
yum install python-devel

Then Installed Cython
==================

wget http://pypi.python.org/packages/source/ ... 5.1.tar.gz
tar -zxvf Cython-0.15.1.tar.gz
cd Cython-0.15.1
python2.6 setup.py install OR python setup.py install (I can't remember)

Then installed pymssql
===================

wget http://pymssql.googlecode.com/files/pym ... 908.tar.gz
tar -zxvf pymssql-1.9.908.tar.gz
cd pymssql-1.9.908
python2.6 setup.py install

I've no idea if this was the right thing to do but Nagios is still running and the scripts now work on some levels, I've got a monitor for the master database on one server, still having trouble with the others.
Windows logins don;t work they come through as DOMAINUser instead of Domain\User but I've got a couple of SQL logins working, only on the database not on the SQL server plugin.

Any help would be appreciated, its hard when you don;t know linux.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Genral Help with MSSQL

Post by scottwilkerson »

You will need to escape these with an additional \

Code: Select all

Domain\\User
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
UnifraxLtd
Posts: 7
Joined: Tue Feb 28, 2012 10:19 am

Re: Genral Help with MSSQL

Post by UnifraxLtd »

I've tried this a few times and it seems to have no effect.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Genral Help with MSSQL

Post by lmiltchev »

I'm not sure if this will fix it, but try:

Code: Select all

Domain/\User
Be sure to check out our Knowledgebase for helpful articles and solutions!
UnifraxLtd
Posts: 7
Joined: Tue Feb 28, 2012 10:19 am

Re: Genral Help with MSSQL

Post by UnifraxLtd »

OK I have a database check on master working using Server\\Administrator on two servers, one is in a domain and the other is a standalone machine. Thats all good. I used the password in this format and left out the instance name but did specify the port (1433).

Here is a command:
check_xi_mssql_database!-H 'IP Address' -U 'Domain\\User' -P 'Password' -T 'master' -p 1433 --activetrans --warning 10 --critical 20

I now have to see if the SQL Server test works and try to monitor something other than the master database. So i will use the same format.

I also discovered last night I could have used yum pymssql to install that software, that would have been easier.
UnifraxLtd
Posts: 7
Joined: Tue Feb 28, 2012 10:19 am

Re: Genral Help with MSSQL

Post by UnifraxLtd »

Right i've added the SQL test and only provided the same information as before (No instance name) and the table name is excluded. I have again provided the admin name as domain\\user.

It seems to connect and some services come back with either ok or critical results but it does not provide any status information, it simply returns - 10.6.0.14:1433 (IP address and Port)

So it must be connecting but it does not provide any status information.

I've just noticed however it is providing data for all the graphs so it must be working and receiving information. This is still just on one server.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Genral Help with MSSQL

Post by scottwilkerson »

I'm going to have Nick the creator of this plugin take a look and chime in with what it should return.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
UnifraxLtd
Posts: 7
Joined: Tue Feb 28, 2012 10:19 am

Re: Genral Help with MSSQL

Post by UnifraxLtd »

Thanks, I've got it monitoring a couple of servers now and I think just 2 of the tests don't connect on all servers. (the response time ones I think). There is definitely no info on the test until you check it and look at the graph and then this all works.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Genral Help with MSSQL

Post by nscott »

Unifrax, it sounds like you've got it up and running then?
Nicholas Scott
Former Nagios employee